By tridnguyen
Hi,
I just created a brand new fedora box.
I then install nginx by running yum install nginx.
I tried to start nginx with the following commands:
$ systemctl enable nginx
$ systemctl restart nginx
However, I got the following error
Failed to read PID from file /run/nginx.pid: Invalid argument
And nginx is not running properly (going to the public IP address of the box does not return anything.
Does anyone know what I did wrong?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This is a known bug with a workaround.
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864
That pid error is often simply caused by restarting Nginx when it isn’t started in the first place. Though the init script should be smart enough to fall back from restart to start. So I don’t think that’s the real problem here. Check to see that Nginx is running and the port that it is listening on by running: netstat -plunt | grep nginx
On Fedora 20, firewalld is running by default. Have you opened port 80?
If the netstat output shows that it is running, then the firewall is most likely your problem. To open the port, run:
firewall-cmd --permanent --zone=public --add-service=http
systemctl restart firewalld.service
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.