Where to put the php project online on the server

angryTom
Release: 2023-02-27 20:50:01
Original
3362 people have browsed it

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; } }
Copy after login

2. Reload Nginx

service nginx restart
Copy after login

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 .
Copy after login

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 #Define the apache /var/www/html area, Change /var/www/html to /home/wwwroot/web1/htdocs

2, restart the Apache server

service httpd restart
Copy after login

3, change permissions

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!