《2022年安装LAMP总结 .pdf》由会员分享,可在线阅读,更多相关《2022年安装LAMP总结 .pdf(6页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、LAMP 安装总结一、安装 MySQL :#添加 mysql 用户和组rootR1 # groupadd mysql rootR1 # useradd -g mysql -M mysql rootR1 # #用户 mysql 不可以用于登录系统rootR1 # vi /etc/passwd mysql:x:500:500:/home/mysql:/sbin/nologin #将 mysql 安装到 /usr/local/mysql 目录rootR1 software# mv mysql-5.1.36-linux-i686-glibc23 /usr/local/mysql rootR1 soft
2、ware# cd /usr/local/mysql/ rootR1 mysql# ls bin data EXCEPTIONS-CLIENT INSTALL-BINARY man README share support-files COPYING docs include lib mysql-test scripts sql-bench rootR1 mysql# #设置用户权限rootR1 mysql# chown -R root:root . rootR1 mysql# chown -R mysql data #初始化数据库rootR1 mysql# ./scripts/mysql_in
3、stall_db -user=mysql & 1 18706 rootR1 mysql# WARNING: The host R1 could not be looked up with resolveip. This probably means that your libc libraries are not 100 % compatible with this binary MySQL version. The MySQL daemon, mysqld, should work normally with the exception that host name resolving wi
4、ll not work. This means that you should use IP addresses instead of hostnames when specifying MySQL privileges ! Installing MySQL system tables. 090808 4:11:46 Warning Forcing shutdown of 2 plugins OK Filling help tables. 090808 4:11:46 Warning Forcing shutdown of 2 plugins OK To start mysqld at boo
5、t time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: ./bin/mysqladmin -u root password new-password 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - -
6、 - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 6 页 - - - - - - - - - ./bin/mysqladmin -u root -h R1 password new-password Alternatively you can run: ./bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly r
7、ecommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd . ; ./bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd ./mysql-test ; perl mysql-test-run.pl Please report any problems with the ./bin/mysqlbug script! The latest
8、 information about MySQL is available at http:/ Support MySQL by buying support/licenses from http:/ #启动 mysql rootR1 mysql# ./bin/mysqld_safe -user=mysql & 1 18813 rootR1 mysql# 090808 04:13:29 mysqld_safe Logging to /usr/local/mysql/data/R1.err. 090808 04:13:29 mysqld_safe Starting mysqld daemon w
9、ith databases from /usr/local/mysql/data #修改 mysql 管理员用户名和密码rootR1 mysql# rootR1 mysql# ./bin/mysqladmin -u root password 850810 rootR1 mysql# ./bin/mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 2 Server version: 5.1.36 MySQL Com
10、munity Server (GPL) Type help; or h for help. Type c to clear the current input statement. mysql #错误日志目录rootR1 mysql# cd data/ rootR1 data# ls ibdata1 ib_logfile0 ib_logfile1 mysql R1.err R1.pid test rootR1 data# more R1.err 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - -
11、 - 第 2 页,共 6 页 - - - - - - - - - 090808 04:13:24 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 090808 4:13:24 Note Plugin FEDERATED is disabled. InnoDB: The first specified data file ./ibdata1 did not exist: InnoDB: a new database to be created! 090808 4:13:24 InnoDB:
12、Setting file ./ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait. 090808 4:13:24 InnoDB: Log file ./ib_logfile0 did not exist: new to be created InnoDB: Setting log file ./ib_logfile0 size to 5 MB InnoDB: Database physically writes the file full: wait. 090808 4:13:24 InnoD
13、B: Log file ./ib_logfile1 did not exist: new to be created InnoDB: Setting log file ./ib_logfile1 size to 5 MB InnoDB: Database physically writes the file full: wait. InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: Creating foreign key constraint system
14、tables InnoDB: Foreign key constraint system tables created 090808 4:13:24 InnoDB: Started; log sequence number 0 0 /usr/local/mysql/bin/mysqld: Too many arguments (first extra is $). Use -verbose -help to get a list of available options 090808 4:13:24 ERROR Aborting 090808 4:13:24 InnoDB: Starting
15、shutdown. 090808 4:13:26 InnoDB: Shutdown completed; log sequence number 0 46409 090808 4:13:26 Warning Forcing shutdown of 1 plugins 090808 4:13:26 Note /usr/local/mysql/bin/mysqld: Shutdown complete 090808 04:13:26 mysqld_safe mysqld from pid file /usr/local/mysql/data/R1.pid ended 090808 04:13:29
16、 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 090808 4:13:29 Note Plugin FEDERATED is disabled. 090808 4:13:29 InnoDB: Started; log sequence number 0 46409 090808 4:13:29 Note Event Scheduler: Loaded 0 events 090808 4:13:29 Note /usr/local/mysql/bin/mysqld: ready for
17、connections. Version: 5.1.36 socket: /tmp/mysql.sock port: 3306 MySQL Community Server (GPL) #查看 mysql 进程rootR1 data# more R1.pid 18864 rootR1 data# #设置 mysql 开机自动启动rootR1 mysql# cp support-files/mysql mysqld_multi.server mysql-log-rotate mysql.server 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - -
18、 - - - - 名师精心整理 - - - - - - - 第 3 页,共 6 页 - - - - - - - - - rootR1 mysql# cp support-files/mysql.server /etc/init.d/mysqld rootR1 mysql# chkconfig mysqld on rootR1 mysql# service mysqld restart Shutting down MySQL.090808 04:16:29 mysqld_safe mysqld from pid file /usr/local/mysql/data/R1.pid ended 确定
19、 Starting MySQL.确定 1+ Done ./bin/mysqld_safe -user=mysql rootR1 mysql# #修改 Mysql 默认字符集rootR1 support-files# cp my-f /etc/f rootR1 support-files# vi /etc/f 修改 f 文件,在该文件中的三个地方(client mysqld mysql )加上default-character-set=utf8 二、安装 Apache:rootR1 software# tar -zxvf httpd-2.2.11.tar.gz rootR1 software#
20、cd httpd-2.2.11 rootR1 httpd-2.2.11# ./configure -prefix=/usr/local/apache -enable-modules=most -enable-ssl -with-mpm=prefork -enable-proxy -enable-proxy-ajp rootR1 httpd-2.2.11# make rootR1 httpd-2.2.11# make install #设置 apache开机自动启动rootR1 apache# vi /etc/rc.local /usr/local/apache/bin/apachectl st
21、art 三、安装 PHP 1、PHP 其它库的安装:#安装 zlib rootR1 zlib-1.2.3# tar -zxvf zlib-1.2.3.tar.gz rootR1 software# cd zlib-1.2.3 rootR1 zlib-1.2.3# ./configure -prefix=/usr/local/zlib rootR1 zlib-1.2.3# make rootR1 zlib-1.2.3# make install #安装 libpng rootR1 software# tar -zxvf libpng-1.2.26.tar.gz rootR1 software#
22、cd libpng-1.2.26 rootR1 libpng-1.2.26# cp scripts/makefile.std makefile rootR1 libpng-1.2.26# make rootR1 libpng-1.2.26# make install 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 6 页 - - - - - - - - - #安装 freetype rootR1 software# tar -zxvf freetype-2.3.5.tar
23、.gz rootR1 software# cd freetype-2.3.5 rootR1 freetype-2.3.5# ./configure -prefix=/usr/local/freetype rootR1 freetype-2.3.5# make rootR1 freetype-2.3.5# make install #安装 jpeg rootR1 freetype-2.3.5# mkdir /usr/local/jpeg6 rootR1 freetype-2.3.5# mkdir /usr/local/jpeg6/bin rootR1 freetype-2.3.5# mkdir
24、/usr/local/jpeg6/lib rootR1 freetype-2.3.5# mkdir /usr/local/jpeg6/include rootR1 freetype-2.3.5# mkdir /usr/local/jpeg6/man rootR1 freetype-2.3.5# mkdir /usr/local/jpeg6/man/man1 rootR1 software# tar -zxvf jpegsrc.v6b.tar.gz rootR1 software# cd jpeg-6b/ rootR1 jpeg-6b# ./configure -prefix=/usr/loca
25、l/jpeg6 -enable-shared -enable-static rootR1 jpeg-6b# make rootR1 jpeg-6b# make install #安装 gd rootR1 software# tar -zxvf gd-2.0.35.tar.gz rootR1 software# cd gd-2.0.35 rootR1 gd-2.0.35# ./configure -prefix=/usr/local/gd2 -with-jped=/usr/local/jpeg6 -with-png -with-zlib=/usr/local/zlib -with-freetyp
26、e=/usr/local/freetype rootR1 gd-2.0.35# make rootR1 gd-2.0.35# make install #安装 curl rootR1 software# tar -zxvf curl-7.15.0.tar.gz rootR1 software# cd curl-7.15.0 rootR1 curl-7.15.0# ./configure -prefix=/usr/local/curl rootR1 curl-7.15.0# make install #安装 libxml rootR1 software# tar -zxvf libxml2-2.
27、6.19.tar.gz rootR1 software# cd libxml2-2.6.19 rootR1 libxml2-2.6.19# ./configure -prefix=/usr/local/libxml2 rootR1 libxml2-2.6.19# make rootR1 libxml2-2.6.19# make install 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 6 页 - - - - - - - - - #安装 libxslt rootR1
28、software# tar -zxvf libxslt-1.1.15.tar.gz rootR1 software# cd libxslt-1.1.15 rootR1 libxslt-1.1.15# ./configure -prefix=/usr/local/libxslt -with-libxml-prefix=/usr/local/libxml2 rootR1 libxslt-1.1.15# make rootR1 libxslt-1.1.15# make install 2、安装 PHP rootR1 software# tar -zxvf php-5.3.0.tar.gz rootR
29、1 software# cd php-5.3.0 rootR1php-5.3.0#./configure -prefix=/usr/local/php -with-mysql=/usr/local/mysql -with-apxs2=/usr/local/apache/bin/apxs -with-zlib=/usr/local/zlib -with-libxml-dir=/usr/local/libxml2 -with-curl=/usr/local/curl -with-freetype-dir=/usr/local/freetype -with-jpeg-dir=/usr/local/j
30、peg6 -with-gd=/usr/local/gd2 -with-xsl=/usr/local/libxslt -enable-sockets -enable-magic-quotes -enable-mbstring -enable-ftp -enable-soap -disable-ipv6 rootR1 php-5.3.0# make rootR1 php-5.3.0# make test rootR1 php-5.3.0# make install 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 6 页 - - - - - - - - -