Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify the php-related paths under ubuntu

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the relevant knowledge of "how to modify php-related paths under ubuntu". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to modify php-related paths under ubuntu" can help you solve the problem.

Php-related paths in ubuntu environment

Php path / usr/bin/php

Phpize5 / usr/bin/phpize5

Php5-fpm / usr/sbin/php5-fpm

All configuration files / etc/php5/fpm for php

Restart php-fpm sudo kill-USR2 `cat / var/run/php5- fpm.pid`

Change the development directory path of php in apache2 in ubuntu

After installing php and apache

How to set the development directory to what you want?

Default development directory address: / var/www

Change: sudo vim / etc/apache2/sites-available/default

Change the two places inside / var/www to the directory you want, mine is / home/dev/www

Or set up a symbolic link under / home/dev:

Ln-s www / var/www (note that www cannot exist in / home/dev)

Then change the permissions: sudo chmod 777 / var/www

Starting apache2

Sudo / etc/init.d/apache2 restart

OK!

You can write a script to test it!

Modify the default root directory of a website under Ubuntu10 Apache2 php5

The default document directory for modifying apache2 under ubuntu10.10 is in / var/www by default.

Sudo gedit / etc/apache2/sites-enabled/000-default

Find DocumentRoot in the document and modify the directory where you want to place the web page file later.

As follows:

1234567891011121314151617181920212223242526272829303132333435363738VirtualHost *: 80 > ServerAdmin webmaster@localhost DocumentRoot / var/www/ Directory / > Options FollowSymLinks AllowOverride None Directory > Directory / var/www/ > Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all Directory > ScriptAlias / cgi-bin/ / usr/lib/cgi-bin/ Directory "/ usr/lib/cgi-bin" > AllowOverride None Options + ExecCGI-MultiViews + SymLinksIfOwnerMatch Order allow,deny Allow from all Directory > ErrorLog ${APACHE_LOG_DIR} / error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR} / access.log combined Alias / doc/ "/ usr/share/doc/" Directory "/ usr/share/doc/" > Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0 Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 255.0.0.0:: 1VirtualHost 128 Directory > VirtualHost *: 8080 > DocumentRoot / var/www/VirtualHost >

The final step is to restart apache

Sudo / etc/init.d/apache2 restart

Ubuntu modifies web root directory

Modify the default document root directory

The default directory for ubuntu is / var/www/html

Need to modify / setc/apache2/sites-enabled/000-default.conf

DocumentRoot / var/www/XXX is fine, and of course, permissions are set, so you can check the ubuntu permission settings.

Ubuntu permission Settings

The usage of chmod under ubuntu (using numbers to assign permissions)

Must have

Ubuntu file permissions are divided into read, write and execute.

Divide according to numbers and distribute according to binary system

The number 4 represents read permission -'r'

The number 2 represents write permissions -'w'

The number 1 represents the execution right--'x'

The number 0 means no rights at all--'-'

File permissions are divided into users, group users, and others.

The position of '123' and'1' represents the user, the position of'2' represents the group user, and the position of'3' represents others

Basic command learning

Permissions to view files

Ls-ld file name / / permissions to view the file

Ls-l / / permission to view all files in a folder

Set permissions for a file

Chmod 777filename / / 7 = 1 + 2 + 4, so all roles are read, write and executable.

Chmod 124filename / / user is execute permission, group user is write permission, others are read permission

Set permissions for all files in the folder

The permissions under chmod-R 777 files / / files are all changed to 7.

Ubuntu modifies the root directory and default page of Apache2 site

Modify the root directory:

Modify 000-default.conf in / etc/apache2/sites-available

Change the DocumentRoot / var/www/ in to the desired directory

For example: DocumentRoot / var/www/html/dokuwiki

Restart after modification: sudo / etc/init.d/apache2 restart

Modify the default web page:

Modify the content in / etc/apache2/mods-available/dir.conf

It turns out that:

123IfModule mod_dir.c > DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htmIfModule >

Add the desired file or path, and the priority is to read it one at a time from the beginning (if there is no file, read the next one), such as adding index.php and dokuwiki

123IfModule mod_dir.c > DirectoryIndex dokuwiki index.php index.html index.cgi index.pl index.php index.xhtml index.htm IfModule > about "how to modify php-related paths under ubuntu" is introduced here. Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report