How to Implement LAMP? 1 make sure that there are no httpdphpmysqlmysql-serverspanrpm-qhttpdphpmysqlmysql-serverspan2 to install 4 development package groups in the system, make sure the following installation will not go wrong spanyum-ygroupinstallDevelopmentLibraries
How to Implement LAMP?
1> make sure there is noHttpd PhpMysql-server
- Rpm-q httpd php mysql-server
2> Install four development package groups to ensure that subsequent installation will not go wrong
- Yum-y groupinstall "Development Libraries" "Development TooLs"" Legacy Software Development "" X Software Development"
3> download: wget httpd lib mysql php and so on
Install lib ExtensionMcRypt only requires./configure & make & makeinstall
4> install and configure mysql:
Create mysql users and groups
- GroupaDd-G 3306 mysql
- Useradd-U 3306-g mysql-M-s/sbin/nologin mysql
- SetEnforce 0 # disable selinux
- Chown-R mysql: mysql/mydata # direct our directory to mysql users and mysql groups
ExtractMysql
- Tar xf mysql-5.5.15-linux2.6-i686.tar.gz-C/usr/local
- Cd/Usr/local
- Ln-Sv mysql-5... mysql ### link the directory of the mysql version to mysql
- Cd mysql
- Chown-R mysql: mysql. ### change the owner Group of the mysql directory to mysql user and mysql group.
- Scripts/mysql_install_db -- user = mysql -- datadir =/mydata/data ### initialize Mysql
Mysql cannot be started at this time.
- Chown-R root. ### change the owner to the root user
- Cp SuPport-FileS/mysql. server/etc/init. d/mysqld ### prepare scripts for mysql to start the required services
- Chkconfig-- Add mysqld ### add to service queue
- Chkconfig mysqld on ### start upon startup
At this time, an error will be reported if it is started. By default, mysql will find the data directory under its installation directory as its data directory.
Prepare the main configuration file for it
- Cp support-files/my-large.cnf/etc/my. cnf
Edit this file and give it a datadir directory
- Vim/etc/my. cnf
- Add: datadir =/mydata/data
- And set thread_coNcUrrency = change to the number of CPU cores x 2.
In this case, the instance can be started normally.
- Service mysqld start
If a startup error occurs, go to/mydata/data/localhost. localdomain. err to view the error message.
At this time, we have not fully prepared Mysql. We also need to prepare its library file and header file.
- Vim/etc/ld. so. conf. d/mysql. conf ### import the database file
- Add:/usr/local/mysql/lib
- Ldconfig ### use ldconfig to reload
- Ln-sv/usr/local/mysql/include/usr/include/mysql ### import the header file
- Vim/etc/profiles ### define the PATH environment variable
- Write: PATH = $ PATH:/usr/local/mysql/bin