Home  >  Article  >  Backend Development  >  Where to put the php project online on the server

Where to put the php project online on the server

angryTom
angryTomOriginal
2019-10-28 11:07:123457browse

Where to put the php project online on the server

Where to put the php project online on the server

After the php project is online, place it in the website root directory of the server. The website root directory of apache is /var/www/html, and the website root directory of nginx is /usr/share/nginx/html/.

1. Change the default website root directory of Nginx

1. The default configuration file of Nginx is located at /etc/nginx/nginx.conf

Modify The server block in the html block:

is changed to the following:

http {
        server{
         listen 80;
         server_name localhost;
 
        location / {
            root   /root;   #把默认路径更改为/root下
            index index.html index.htm;
        }
}

2. Reload Nginx

service nginx restart

3. Modify the file permissions

Default root Directory permissions are: drwx------ 6 root root 4096 Jun 22 20:12 .

is modified to 777:

chmod 777 .

2. Change the apache default website root directory

1. vi /etc/httpd/conf/httpd.conf

Find the DocumentRoot "/var/www/html" section of #apache's root directory, and change / Change the directory var/www/html to /home/wwwroot/web1/htdocs

Find b25f3f9032903015d928a17f9e057706 #Define the apache /var/www/html area, Change /var/www/html to /home/wwwroot/web1/htdocs

2, restart the Apache server

service httpd restart

3, change permissions

chmod -R 755 /home/wwwroot/web1/htdocs
chown apache.apache /home/wwwroot/ -R

recommended :【Linux video tutorial

The above is the detailed content of Where to put the php project online on the server. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn