@David138

Как загрузить страницу в Lamp?

Привет. Апач без проблем запустился в браузере. Но хочу загрузить пробную страницу и выдает ошибку при запуске Попытка соединения не удалась. А вот такие команды и писал:

$ sudo apt -y install apache2
$ sudo apt -y install default-mysql-server
$ sudo apt -y install php7.4 libapache2-mod-php7.4 php7.4-mysql php-curl php-json php-cgi php-gd php-zip php-mbstring php-xml php-xmlrpc
$ cat /mnt/c/Windows/system32/drivers/etc/hosts
...
#       127.0.0.1       localhost
...
$ cat /mnt/c/Windows/system32/drivers/etc/hosts
...
        127.0.0.1       localhost
..
$ sudo ufw allow in 80/tcp
Rules updated
Rules updated (v6)
$ sudo service apache2 restart
 * Restarting Apache httpd web server apache2                                              [ OK ]
$ sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/testsite.conf
$ sudo vim /etc/apache2/sites-available/testsite.conf
$ cat /etc/apache2/sites-available/testsite.conf
<VirtualHost *:80>
        ServerAdmin webmaster@testsite
        ServerName testsite
        ServerAlias www.testsite
                DocumentRoot /mnt/c/Users/web-lamp/testsite/
                <Directory /mnt/c/Users/web-lamp/testsite/>
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted
                </Directory>
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
$ cd /mnt/c/Users/
$ mkdir web-lamp
$ cd web-lamp
$ mkdir testsite
$ cd testsite
$ vim index.php
$ cat index.php
<?php
echo "Hello!";
?>
$ cd ~
$ sudo a2ensite testsite.conf
Enabling site testsite.
To activate the new configuration, you need to run:
  service apache2 reload
$ sudo service apache2 reload
 * Reloading Apache httpd web server apache2                                                                             *
$ cat /mnt/c/Windows/System32/drivers/etc/hosts
...
        127.0.0.1       localhost
...
$ sudo vim /mnt/c/Windows/System32/drivers/etc/hosts
$ cat /mnt/c/Windows/System32/drivers/etc/hosts
...
        127.0.0.1       localhost
        127.0.0.1       testsite
...
$ sudo service apache2 restart
 * Restarting Apache httpd web server apache2                                                                    [ OK ]
  • Вопрос задан
  • 87 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы