资源描述
常用命令
rpm -Uvh *.rpm --nodeps --force 不管关联关系,直接强行安装rpm
tar czvf usr.tar.gz /home 把home目录下的文件压缩成usr.tar.gz
r==4
w==2
x==1
--------------------------------------------------------------
LAMP
一、安装gd2
1、准备好安装包
bzip2-devel
zlib-devel
libjpeg-devel
libpng-devel
libtiff-devel
freetype-devel
openssl-devel
libxml2-devel
libgcj
gettext-devel
2、安装gd2
tar zxvf gd-2.0.35.tar.gz
./configure --prefix=/soft/gd2
make
make install
二、安装apache2.0.55
./configure --prefix=/soft/apache --enable-ssl --enable-so --enable-rewrite --enable-proxy --enable-modules=so --enable-mods-shared=all --disable-cgid --disable-cgi
make
make install
将apache设置为系统服务
cp /soft/apache/bin/apachectl /etc/rc.d/init.d/httpd(提示覆盖?Y)
vi /etc/rc.d/init.d/httpd
#!/bin/sh
#chkconfig: 2345 10 90
#description: Apache is a World Wide Web server
chkconfig --add httpd(如果出现错误,看上面有没有拼写错误)
chkconfig httpd on
service httpd start apache启动
service httpd stop apache停止
service httpd restart apache重新启动
输入ip看有没有欢迎界面!
三、安装MYSQLForLinuxV5.0.22.tar.gz
./configure --prefix=/soft/mysql --without-bench --with-comment=Source --with-server-suffix=-enterprise-gpl --with-mysqld-user=postcn --without-debug --with-big-tables --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-pthread --enable-static --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --without-innodb --without-ndb-debug --enable-local-infile --with-readline --with-raid
groupadd postcn (userdel -r mysql) 创建postcn新组
useradd -g postcn postcn 创建postcn用户,并且设置在postcn组里
make
make install
cp support-files/my-f /etc/f 把f(相当于windows下的my.ini)拷贝到etc下面
cd mysql/bin
./mysql_install_db --user=postcn 创建mysql用户postcn
chown -R root /soft/mysql #设定root能访问/soft/mysql
chown -R postcn /soft/mysql/var/mysql #设定postcn 用户能够访问/var/mysql
chgrp -R postcn /soft/mysql #设定postcn 组能访问/soft/mysql
cp mysql.server /etc/rc.d/init.d/mysqld #support-files下的 执行下面的命令复制启动脚本到资源目录
chmod +x /etc/rc.d/init.d/mysqld 执行下面的命令增加mysqld服务控制脚本执行权限
chkconfig --add mysqld 执行下面的命令将mysqld服务加入到系统服务
chkconfig --list mysqld 执行下面的命令检查mysqld服务是否已经生效
service mysqld start
注:ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock'
解决方法:1、cp support-files/my-f /etc/f 2、bin/mysql_install_db --user=postcn 3、bin/mysqld_safe --user=postcn &
进mysql: cd /bin--> ./mysql
四、安装php4.4.0
./configure --prefix=/soft/php --with-apxs2=/soft/apache/bin/apxs --with-mysql=/soft/mysql --with-zlib-dir --with-bz2 --with-libxml-dir --with-gd=/soft/gd2 --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-ttf --enable-mbstring --enable-magic-quotes --enable-track-vars --enable-force-cgi-redirect --with-config-file-path=/soft/php/etc --with-iconv --disable-ipv6 --enable-static --enable-zend-multibyte --enable-inline-optimization --enable-zend-multibyte --enable-sockets --enable-soap --with-openssl --with-gettext --enable-ftp
make
make install
cp php.ini-recommended /etc/php.ini
五、安装ZendOptimizer-3.0.1
1、./install.sh
2、OK-->EXIT-->YES-->/soft/Zend-->php.ini在etc下面-->yes-->/soft/apache/bin/apachectl(自己设定)-->OK-->重启httpd-->successfully!-->OK!
六、整合apache 跟php
1、修改DocumentRoot "/app/web"
2、增加AddType application/x-httpd-php .php
3、增加DirectoryIndex index.php index.html index.html.var
4、如果没有LoadModule php4_module modules/libphp4.so这句,那么先find / -name libphp4.so 然后把它拷贝到apache modules下面,然后修改它的权限chmod 755
5、如果有LoadModule php4_module modules/libphp4.so这句,那么在下面加上PHPiniDir "/soft/Zend/etc/php.ini"
七、修改Zend
1、打开邮政备份文件,打开php.ini进行配置,基本要覆盖
2、如果解码不了那么删了Zend文件夹,然后重装
httpd.conf
AddType application/x-httpd-php .do
AddType application/x-httpd-php .php
AddType application/x-httpd-php .htm1
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
八、建立text.php查看LAMP环境是否搭建成功
touch test.php
<?php
phpinfo();
?>
九、进入app/web 解压网站目录
十、修改mysql数据库用户名密码
bin/mysqladmin -u postcn password postcn@Mysql
下面创建一个postcn 用户,密码为postcn@Mysql,并且只能对cn_gov_postcn数据库进行操作的命令
GRANT ALL ON cn_gov_postcn.* TO postcn IDENTIFIED BY "postcn@Mysql";
数据导入:直接把Database_data下的cn_gov_postcn文件拷贝到/soft/mysql/var/cn_gov_postcn目录下
十一、安装tomcat
1、安装jdk
2、配置环境变量 vi /etc/profile
JAVA_HOME=/usr/java/jdk1.6.0_01
CLASSPATH= $JAVA_HOME/lib: $JAVA_HOME/jre/lib
PATH= $PATH: $JAVA_HOME/bin: $JAVA_HOME/jre/bin
export PATH CLASSPATH JAVA_HOME
如果在打开网站的时候提示mysql数据表为只读的话,那么就首先找到数据库目录看下mysql数据库的权限是怎样的,然后按照mysql的权限更改你不能打开的数据库
chown -R root:mysql 数据文件 mysql
chmod -R root:mysql 数据文件 mysql
chmod 666 数据文件
展开阅读全文