Answer the question
In order to leave comments, you need to log in
Nginx opens its page even though it is disabled. How to make apache work?
Hello. In general, the employer gave me a task where I need to make a web server, I'm almost zero in this) So - I installed apache, nginx, php-fpm. all of them by default on port 80, right? Next, I configured fpm and nginx for certain folders so that there was a php-fpm / fastcgi mode. Then I need to make two folders (sites) in mod_php and cgi modes. In theory, you need to transfer apache to 8080, but for now I decided to leave it. I disabled nginx and php fpm.
service nginx stop
service php-fpm stop
then I go to localhost and see the nginx page. I don't understand why is that? I don’t understand how it can even work if I turned it off? Why is apache not running?(service httpd start [OK!])
directives in httpd.conf seem to be correct
---------------
nginx.conf
------------
user nginx;
worker_processes 1;
pid /var/run/nginx.pid;
error_log /var/log/nginx-error.log warn;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
server_tokens off;
fastcgi_intercept_errors on;
client_max_body_size 50m;
server_namelocalhost;
rewrite ^ http://localhost$request_uri? permanent;
}
# site3
server {
listen 80;
server_name site3.ru;
root /var/www/awp/site3.ru/;
index index.php index.html index.htm;
access_log /var/www/awp/site3.ru/access.log main;
error_log /var/www/awp/site3.ru/error.log;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~* ^.+.(js|css|png|jpg|jpeg|gif|ico)$ {
access_log off;
expires max;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param DOCUMENT_ROOT /var/www/awp/site3.ru/;
fastcgi_param SCRIPT_FILENAME /var/www/awp/site3.ru/$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED /var/www/awp/site3.ru/$fastcgi_script_name;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
location = /favicon.ico {
log_not_found off;
access_logoff;
}
location = /robots.txt {
allow all;
log_not_found off;
access_logoff;
}
location ~ /\.ht {
deny all;
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question