I just create a server recently, and use Nginx as my web server.
I did : service nginx force-reload
Reloading nginx configuration nginx [ OK ]
Then I do service nginx status
nginx is running
Knowing that my site is running, but when I go to it. I see No input file specified. Wired ???
Here is what I have in my /etc/nginx/sites-available/default
server {
listen 80 default_server;
server_name default;
root /default/public;
Can someone please help me fix this ?
I fix this problem by assign my document root to the correct path :
root /home/forge/default/public;
If you see No input file specified., make sure you set your root to the correct path.
Related
I'll try to be short as it can get bloated.
I set up an ubuntu server 20.04 VM on an Oracle vbox.
I installed nginx, php7.4, Xdebug 3.
I configured everything properly for remote debugging and sftp ( I use PHPstorm), I forwarded the ports and customized my local hosts file.Everything works except...
when loading HTTP://127.0.0.2 it loads the default nginx landing page.My index.php file is uploaded in the root /var/www/my_domain folder through sftp. I created the server block for my_domain.
Still won't work. I am new to this so I am missing something.
If you need more info please request.
Any help appreciated!
Vhost config ( server block in nginx) - php-projects being my current domain and containing index.php:
server {
listen 80;
listen [::]:80 ipv6only=on;
root /var/www/php-projects;
server_name php-projects www.php-projects;
location / {
try_files $uri $uri/ =404;
}
error_log /var/log/nginx/debug.log debug;
}
Network settings from Vbox:
PS. I have tried :
How to set index.html as root file in Nginx?
and
Rewrite rule for the root file in nginx?
with no success.
"I configured everything properly for remote debugging and sftp"
Please post your xdebug configuration.
"when loading HTTP://127.0.0.2"
From where ? Host machine or VM?
"My index.php file is uploaded in the root /var/www/my_domain folder
through sftp."
Please post your nginx vhost configuration
"I created the server block for my_domain"
Where? Post the path to the file where you have done this
I have installed apache on centos 7 and setup nginx as a reverse proxy for apache. Apache listens into 8080 and nginx into 80. I have two virtual hosts and also two server blocks.
Everything is OK and I can see my two server addresses: www1.mysite.com and www2.mysite.com
Now I install php-fpm to run php script. Near to one of my tested index.html files in my websites' root directory, I create an info.php file to see something printed by php. But I encounter a 503 error (unavailable service). What is wrong with my simple configuration do you think?
Any idea or similar experience would help me. Thank you in advance
My problem was almost funny. I had named my sock file php-fpm.sock but it was another name in the php-fpm config file.
I made them equal and the problem was resolved. Hope nobody encounter this rediculous mistake.
I am using set in my nginx virtual hosts to set the domain once so I can just re-use it all over the file since I name my directories exactly like the domains.
The issue is that nginx seems to completly ignore the variables I set and it just uses the variable itself instead of the value. So www.$appDomain results in www.$appDomain instead of www.domain.com.
Any idea how to fix this?
Virtual Host /etc/nginx/sites-available/domain.com
server {
set $appDomain "domain.com";
root /var/www/html/$appDomain;
server_name $appDomain www.$appDomain;
ssl_certificate /etc/letsencrypt/live/$appDomain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$appDomain/privkey.pem;
}
Error with sudo nginx -t
nginx: [emerg] BIO_new_file("/etc/letsencrypt/live/$appDomain/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/$appDomain/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
I have tried going to Apache, open httpd.conf and change the lines #Listen 12.34.56.78:80; Listen 80 to #Listen 12.34.56.78:80; 8080 and still it did not work. I have went to control panel and System & Security-> Administrative Tools-> Services, then Web Development Service (It did not exist). I also tried start->run->cmd and pressing ctrl + shift + enter, to open command window. I typed net stop MsDepSvc and it did not work either. I know it is there some where because I keep getting the error that HTTPAPI/2.0 is running. What else can I try?
I am getting an error when I try to turn off Microsoft-HTTPAPI/2.0 In order for me to get wampserver on, I have disable the HTTPAPI/2.0 but my computer for some reason does not show the Web Development Service Agent. So What do I do?
None of the comments listed below helped. It cannot find certain files either.
If you have Microsoft SQL Server installed with SQL Server Reporting Services try to stop or disable this service from Control Panel->System and Security->Administrative Tool->Services->SQL Server Reporting Services (InstanceName). More details how to find this service here.
Other cause to block 80 port is Skype.
And if you want to change the apache port to 8080 you need to do this:
Find in httpd.conf the lines :
#Listen 12.34.56.78:80
Listen 0.0.0.0:80
Listen [::0]:80
and replace wtith:
#Listen 12.34.56.78:8080
Listen 0.0.0.0:8080
Listen [::0]:8080
and after restart Wamp server.
You replace only the commented line. The line start with # is comment in httpd.conf. The next line after this is what to replace like in my example.
I'm not so good with nginx but i try to make somthing with that and fresh installed gitlab.
So i intall on digitalocean Gitlab. One click installer (ubuntu 13.10). But now i try to install php and phpmyadmin and after that i want to make somthing ridiculous. I want move main repository map from /home/gitlab/gitlab-satellites to main root of my dev (same server).
So gitlab need to be on my_domain.com/gitlab, and main dev server location will be my_domain.com.
Is this possible or?
you can find the nginx conf files in the gitlab installation: gitlab/nginx/etc
which will be '/var/opt/gitlab/nginx/etc' in the default install
you can then edit the .conf files as necessary
Example on the 'gitlab-http.conf' file you will find:
server {
listen *:80;
server_name git.your-domain-name.com;
you will have to create similar virtual hosts on NGINX for
server {
listen *:80;
server_name your-domain-name.com;
OR
server {
listen *:80;
server_name *.your-domain-name.com;