In Linux, the default installation path of Apache PHP Mysql is apachemysql.
Apache
If the RPM package is used for installation, the installation path should be in the/etc/httpd directory.
Apache configuration file:/etc/httpd/conf/httpd. conf
Apache module path:/usr/sbin/apachectl
Web directory:/var/www/html
If source code is used for installation, it is usually installed in the/usr/local/apache2 directory by default.
PHP
If the RPM package is used for installation, the installation path should be in the/etc/directory.
Php configuration file:/etc/php. ini
If source code is used for installation, it is usually installed in the/usr/local/lib directory by default.
Php configuration file:/usr/local/lib/php. ini or/usr/local/php/etc/php. ini
Mysql
If the RPM package is used for installation, the installation path should be in the/usr/share/mysql directory.
Mysqldump File Location:/usr/bin/mysqldump
Mysql configuration file:/etc/my. cnf or/usr/share/mysql/my. cnf
Mysql data directory:/var/lib/mysql directory
If source code is used for installation, it is usually installed in the/usr/local/mysql directory by default.
Write a script for automatic installation of mysql apache php in Linux
1.1 compile and install
# Groupadd mysql
# Useradd-g mysql-d/usr/local/lib/mysql-s/sbin/nologin mysql
# Tar zxvf mysql-x.x.x
# Cd mysql-x.x.x
#. /Configure -- prefix =/usr/local/lib/mysql -- localstatedir =/usr/local/lib/mysql/data -- with-charset = utf8 -- with-extra-charsets = all
# Make
# Make install
# Cp support-files/my-medium.cnf/etc/my. cnf
# Cd/usr/local/lib/mysql
# Mkdir data
# Bin/mysql_install_db -- user = mysql
# Chown-R root.
# Chown-R mysql data
# Chgrp-R mysql.
# Echo "/usr/local/lib/mysql/bin/mysqld_safe &">/etc/rc. local
#/Usr/local/lib/mysql/bin/mysqld_safe -- user = mysql &
1.2 access the mysql DBMS
#/Usr/local/lib/mysql/bin/mysql-u root-p
Enter password: <Enter>
* Note: The default mysql root User Password is blank.
1.3 The problem that mysql Data is garbled in Chinese on the page
-- With-extra-charsets = all is a key parameter for Solving Chinese garbled characters. It is used to install additional character sets, including Chinese character sets such as gbk. When creating a database, manually specify the character set as gbk to ensure that the HTML page that uses the same gbk character set displays Chinese normally:
Create database <db_name> default character set gbk collate gbk_chinese_ci;
2. install Apache
====================
2.1 compile and install
# Tar zxvf httpd-x.x.x.tar.gz
# Cd httpd-x.x.x
#./Configure -- prefix =/usr/local/lib/apache -- enable-so -- enable-mod-shared = all -- enable-rewrite = shared -- enable-speling = shared
# Make
# Make install
2.2 apache startup Stop command
#/Usr/local/lib/apache/bin/apachectl start
#/Usr/local/li ...... remaining full text>
Where is the default path of mysql and Apache in CentOS?
The installation path is under/var.
The configuration file is under/etc, for example, mysql, or/etc/mysql/