cd /usr/local/mysql
bin/mysqld --user=mysql --initialize-insecure --user=mysql --datadir=/usr/local/mysql/data
/usr/local/mysql/support-files/mysql.server start
cd /usr/local/mysql
chown -R mysql:mysql .
cd /usr/local/mysql/data
chown -R mysql:mysql .
初始化数据库
cd /usr/local/mysql
/usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data
# 获取临时密码
grep 'temporary password' /var/log/mysqld.log
# 使用临时密码登录
mysql -u root -p
# 修改root账户的密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '11111111a';
yum install libxml
tar -zxvf libxml2-2.9.0.tar.gz
cd ./libxml2-2.9.0
./configure --prefix=/usr/local/libxml2/
make && make install
tar -zxvf libmcrypt-2.5.7.tar.gz
cd ./libmcrypt
./configure --prefix=/usr/local/libmcrypt/
make -j4
make install
cd /usr/local/lamp/libmcrypt-2.5.7/libltdl
./configure -enable-ltdl-install
make -j4
make install
tar -zxvf zlib.tar.gz
./configure --prefix=/usr/local/zlib/
make && make install
[root@centos6 LAMP]# cd /usr/local/LAMP
[root@centos6 LAMP]# tar -zxvf libpng-1.5.4.tar.gz
[root@centos6 LAMP]# cd ./libpng-1.5.4
[root@centos6 libpng-1.5.4]# ./configure --prefix=/usr/local/libpng/ --enable-shared
[root@centos6 libpng-1.5.4]# make && make install
[root@centos6 LAMP]# cd /usr/local/LAMP
[root@centos6 LAMP]# tar -zxvf freetype-2.5.3.tar.gz
[root@centos6 LAMP]# cd ./freetype-2.5.3
[root@centos6 freetype-2.5.3]#./configure --prefix=/usr/local/freetype/ --enable-shared
[root@centos6 freetype-2.5.3]# make && make install
[root@centos6 LAMP]# cd /usr/local/LAMP
[root@centos6 LAMP]# tar -zxvf autoconf-2.69.tar.gz
[root@centos6 LAMP]# cd ./autoconf-2.69
[root@centos6 autoconf-2.69]# ./configure
[root@centos6 autoconf-2.69]# make && make install
[root@centos6 LAMP]# cd /usr/local/LAMP
[root@centos6 LAMP]# tar -zxvf libgd-2.1.0.tar.gz
[root@centos6 LAMP]# cd ./libgd-2.1.0
[root@centos6 libgd-2.1.0]# ./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg/ --with-png=/usr/local/libpng/ --with-zlib=/usr/local/zlib/ --with-freetype=/usr/local/freetype/
[root@centos6 libgd-2.1.0]# make && make install
[root@centos6 LAMP]# yum remove apr apr-util
[root@centos6 LAMP]# tar zxvf apr-1.5.2.tar.gz
[root@centos6 LAMP]# cd apr-1.5.2
[root@centos6 apr-1.5.2]# ./configure --prefix=/usr/local/apr-httpd/ && make && make install
[root@centos6 LAMP]# tar zxvf apr-util-1.5.4.tar.gz
[root@centos6 LAMP]# cd apr-util-1.5.4
[root@centos6 apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/ && make && make install
[root@centos6 LAMP]# unzip pcre-8.34.zip
[root@centos6 LAMP]# cd pcre-8.34
[root@centos6 pcre-8.34]# ./configure --prefix=/usr/local/pcre
[root@centos6 pcre-8.34]# make
[root@centos6 pcre-8.34]# make install
安装apache
[root@centos6 LAMP]# tar zxvf httpd-2.4.18.tar.gz
[root@centos6 LAMP]# cd httpd-2.4.18
./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-deflate --enable-speling--enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-so --enable-expires=shared --enable-rewrite=shared --enable-static-support --sysconfdir=/etc/httpd --with-z=/usr/local/zlib/ --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/ --with-pcre=/usr/local/pcre/ --disable-userdir
[root@centos6 httpd-2.4.18]# make && make install
安装完成后,进入/usr/local/apache2/目录下,检查是否有以下文件:
bin build cgi-bin error htdocs icons include
logs man manual modules
启动Apache服务器,并查端口是否开启,启动Apache服务器的命令行如下:
[root@centos6 httpd-2.4.18]# /usr/local/apache2/bin/apachectl start
添加到快速启动:
[root@centos6 httpd-2.4.18]#cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
以后就可以这样了:
/etc/init.d httpd stop
/etc/init.d httpd start
/etc/init.d httpd restart
如果不能启动,提示信息:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
解决方案:
root@centos6 httpd-2.4.18]# vim /etc/httpd/httpd.conf
写入:
ServerName localhost:80
重启apache
service httpd stop
service httpd start
查看端口号,应该是这样的:
netstat -tnl|grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LIST
测试,浏览器输入你的IP地址,出现It works!安装成功
设置开机启动:
vim /etc/rc.local
添加:
/usr/local/apache/bin/apachectl start
:wq保存退出
tar -zxvf openssl
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl -enable-zlib --with-zlib-lib=/usr/local/zlib/lib --with-zlib-include=/usr/local/zlib/include
make && make install
./config -t
make depend
在/etc/ld.so.conf文件的最后面,添加如下内容:/usr/local/openssl/lib
然后执行以下命令
ldconfig
wget https://curl.haxx.se/download/curl-7.59.0.tar.gz
cd curl
./configure -prefix=/usr/local/curl --with-php-config=/usr/local/php/bin/php-config
make -j4 && make install -j4
找到
DirectoryIndex index.html
修改为
DirectoryIndex index.php index.html index.htm
重启apache
service httpd stop
service httpd start
验证
apache服务器的网站根目录为 /usr/local/apache2/htdocs/
vim /usr/local/apache2/htdocs/index.php
写入
phpinfo();
?>
:wq 保存退出
浏览器访问
date模块下可能会出现:
It is not safe to rely on the system’s timezon....
解决:
vim /usr/local/php/etc/php.ini
找到:
;date.timezone =
改成:
date.timezone = "Asia/Shanghai"
重启apache:
service httpd restart
安装完成
cd /usr/local/lamp/php-5.7.2/ext/openssl
ln -s config0.m4 config.m4
/usr/local/php/bin/phpize
./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config
make && make test && make install
cd /usr/local/lamp/php-5.7.2/ext/mbstring
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
cd /usr/local/lamp/php-5.7.2/ext/curl
/usr/local/php/bin/phpize
./configure --with-curl=/usr/local/curl --with-php-config=/usr/local/php/bin/php-config
make && make test && make install
download glpi:
extract to /var/www/html/
Edit:
[root@ITMontest changelogbak]# ll
total 224
central.class.php
html.class.php
[root@ITMontest changelogbak]# pwd
/var/www/html/glpi/inc/
/var/www/html/glpi/pic/
fd_logo.png
login_logo_glpi.png