Correlation Path and Modification Method of php in ubuntu Environment

  • 2021-08-31 09:51:22
  • OfStack

php-related paths in an ubuntu environment

php path/usr/bin/php phpize5/usr/bin/phpize5 php5-fpm/usr/sbin/php5-fpm php All Configuration Files/etc/php5/fpm 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 the desired one

Default development directory address:/var/www

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

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

Or establish a symbolic link under/home/dev:

ln-s www/var/www (Note that www cannot be present in/home/dev)

Then change permissions: sudo chmod 777/var/www

After starting apache2

sudo /etc/init.d/apache2 restart

OK!
Can write a script test under 1! ! !

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

The default document directory for modifying apache2 under ubuntu10.10 is the/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 webpage files later.

As follows:


<VirtualHost *: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/255.0.0.0 ::1/128
  </Directory>
</VirtualHost>
<VirtualHost *:8080>
	DocumentRoot /var/www/
</VirtualHost>

The last step is to restart apache

sudo /etc/init.d/apache2 restart

ubuntu Modify web Root Directory

Modify the default document root directory
The default directory for ubuntu is/var/www/html
Need to be amended/setc/apache2/sites-enabled/000-default. conf
DocumentRoot/var/www/XXX will do. Of course, you have to set the permissions, so you can view the ubuntu permissions settings

ubuntu Permission Settings

Usage of chmod under ubuntu (assignment of privileges using numbers)

Necessary

ubuntu file permissions are divided into read, write, and execute
Divided according to numbers and distributed according to binary system
The number 4 stands for read permission----'r'
The number 2 stands for write permission----'w'
The number 1 stands for executive permission--'x'
The number 0 means no permission--'-'

File permissions are divided into user, group user, and other

The bits of '123' and '1' represent users, the bits of '2' represent group users, and the bits of '3' represent others
Basic command learning
Permissions to view files
ls-ld Filename//Permissions to view files
ls-l//Permissions to view all files in a folder
Set the permissions of the file
chmod 777 Filename//7 = 1 + 2 + 4 So file permissions are read, write, executable for all roles
chmod 124 Filename//User is execute permission, group user is write permission, others are read permission
Set permissions for all files in the folder
chmod-R 777 The permissions under the file//file are all changed to 7

Ubuntu Modify Apache2 Web Site Root Directory and Default Web Page

Modify the root directory:
Modify 000-default. conf in/etc/apache2/sites-available
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 page:
Modifications in/etc/apache2/mods-available/dir. conf
It turned out to be:


<IfModule mod_dir.c>
  DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

Add the desired file or path on, and the priority is to read it one after another from the beginning (no file reads the next one), such as adding index. php, dokuwiki


<IfModule mod_dir.c>
  DirectoryIndex dokuwiki index.php index.html index.cgi index.pl index.php index.xhtml index.htm 
</IfModule>

Related articles: