and filzela to transfer files
Perfect.
Let's find out a few things.
What are the outputs of these commands?
sudo apachectl -S
sudo ls -lRa /etc/apache2/sites-available
sudo ls -lRa /etc/apache2/sites-enabled
Please put 3 backticks above and below each output, like this:
```
output
```
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo apachectl -S
VirtualHost configuration:
*:80 guesthost.tech (/etc/apache2/sites-enabled/000-default.conf:4)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
/etc/apache2/sites-available:
total 16
drwxr-xr-x 2 www-data www-data 4096 Jun 1 22:12 .
drwxr-xr-x 8 www-data www-data 4096 Jun 2 11:53 ..
-rw-r--r-- 1 www-data www-data 511 Dec 16 14:56 000-default.conf
-rw-r--r-- 1 www-data www-data 1332 Apr 13 2020 000-default.conf.dpkg-dist
/etc/apache2/sites-enabled:
total 12
drwxr-xr-x 2 www-data www-data 4096 Jun 9 21:46 .
drwxr-xr-x 8 www-data www-data 4096 Jun 2 11:53 ..
-rw-r--r-- 1 www-data www-data 709 Jun 1 17:41 000-default.conf```
Thanks for that.
What are the outputs of these commands?
sudo cat /etc/apache2/sites-available/000-default.conf
sudo cat /etc/apache2/sites-enabled/000-default.conf
Do you have a .htaccess
file in your webroot directory (/var/www/html/.htaccess
)?
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo cat /etc/apache2/sites-enabled/000-default.conf
# Added to mitigate CVE-2017-8295 vulnerability
UseCanonicalName On
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName guesthost.tech
ServerAlias www.guesthost.tech
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =guesthost.tech [OR]
RewriteCond %{SERVER_NAME} =www.guesthost.tech
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# ^C
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo cat /etc/apache2/sites-available/000-default.conf
# Added to mitigate CVE-2017-8295 vulnerability
UseCanonicalName On
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName $domain
ServerAlias www.$domain
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo cat /etc/apache2/sites-enabled/000-default.conf
# Added to mitigate CVE-2017-8295 vulnerability
UseCanonicalName On
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName guesthost.tech
ServerAlias www.guesthost.tech
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =guesthost.tech [OR]
RewriteCond %{SERVER_NAME} =www.guesthost.tech
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
Can you please edit your last post to fix the backticks? The top of the first file got cutoff.
sorry I have edited the post thank you
I don't have the .htaccess
file i have checked
- Remove the bad configuration.
sudo rm /etc/apache2/sites-enabled/000-default.conf
- Fix the good configuration.
sudo nano /etc/apache2/sites-available/000-default.conf
Replace $domain
in the ServerName
and ServerAlias
with guesthost.tech
- Enable the good configuration.
sudo a2ensite 000-default.conf
- Reload Apache.
sudo apachectl -k graceful
- Check the status.
sudo apachectl -S
how to :
Replace $domain
in the ServerName
and ServerAlias
with guesthost.tech
after I have executed the command
That command should bring up the nano
text editor to make the changes.
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo a2ensite 000-default.conf
Enabling site 000-default.
To activate the new configuration, you need to run:
systemctl reload apache2
I Reload apache or I run the command ?
Just go to the next step. It instructs you to gracefully reload apache with a different command.
oki =) I must learn to code I adore this =)
this is the result
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo apachectl -k graceful
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo apachectl -S
VirtualHost configuration:
*:80 guesthost.tech (/etc/apache2/sites-enabled/000-default.conf:4)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
Now set the Cloudflare SSL option to Off.
It's done What next Sir
What is the output of this command?
sudo cat /etc/apache2/sites-enabled/000-default.conf