Question

My website won't come up in the browser, the server comes up, apache runs

Posted September 17, 2021 105 views
Apache

I can telnet into my droplet and see my files and it looks ok, but website not coming up in browser. The droplet is about 3 years old and has been working fine for the most part. I have 3 other droplets created about the same time with the same software. 2 are working and one is not. I opened a ticket and basically their response is,

curl -ILk xxxxxxxxxx.com
HTTP/1.1 403 Forbidden
Date: Fri, 17 Sep 2021 03:49:23 GMT
Content-Type: text/html
Content-Length: 146
Connection: keep-alive
Server: nginx
Vary: Accept-Encoding

Generally, the error that you are seeing will be caused by incorrect permissions to a resource. The 403 response code is caused by incorrect permissions, whether it be authorizations or file permissions.

The first step in troubleshooting this error is to ensure the file exists inside your website’s webroot on the server. The webroot is generally located somewhere within /var/www , however, you can also check where it is inside the configuration file located at /etc/nginx/sites-enabled or /etc/nginx/nginx.conf

Once you have verified that the file/directory exists, you will need to check the permissions. If you have a standard nginx installation then the service will be run as a www-data user so you will need to ensure that the file can be accessed by that user. This is usually done by simply changing the group of resources to www-data

The files are there with the correct permissions. Other commands I have tried,

ps -aux
systemctl status apache2
tail -F /var/log/apache2/error.log
there are errors, but apache is up and running

grep -i kill /var/log/syslog

/usr/sbin/apache2
AH00111: Config variable ${APACHEPIDFILE} is not defined

apache2ctl configtest
Syntax OK

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Hi @whetzels1,

I’ve noticed you’ve mentioned you are using Apache, but you’ve checked some Nginx configuration files. I’ll recommend checking your Apache config files in:

/etc/apache2/sites-enabled

In there you can check your domain’s config file and find the correct Documentroot of your domain. Additionally, you mentioned permissions but ownership can be the cause of this as well.

Go to your document root and type in ls -lah what does it show? Are all users and group root:root? If yes, then you’ll need to change them. Usually, Apache uses www-data rather than root.

Show answer This answer has been marked as resolved by whetzels1.