Сайт на Apache2
- Автор Тестировщик
- Опубликовано в Управление и мониторинг
- Прочитано 1125 раз
- Печать
- Добавить комментарий
1. Устанавливаем пакеты:
apt install -y apache2 php php-cli php7.0-common libapache2-mod-php
2. Включаем модуль:
a2enmod php7.0
3. Перезапускаем apache2:
systemctl restart apache2
4. Создадим файл в котором будет содержаться тело сайта:
Переходим в каталог;
cd /var/www/html
Создаем файл
nano info.php
В файл вносим:
<!DOCTYPE html>
<html>
<head>
<title>my chart</title>
</head>
<body>
<canvas id="myChart"></canvas>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script type="text/javascript">
const labels = [
'January',
'February',
'March',
'April',
'May',
'June',
];
const data = {
labels: labels,
datasets: [{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45],
}]
};
const config = {
type: 'bar',
data: data,
options: {}
};
</script>
<script>
const myChart = new Chart(
document.getElementById('myChart'),
config
);
</script>
</body>
</html>
5. Проверяем в браузере
http://localhost/info.php
Размещение рекламных спам сообщений неэффективно, не утруждайтесь.