1、LAMP平台配置编译安装Apache编译安装解压配置编译并安装即可或者直接配置编译安装安装mysql创建运行mysql的帐号解压 配置 编译 安装-Error: No curses/termcap library found问题原因没有 curses/termcap支持的软件包解决方法:yum -y install libtermcap-develncurses-5.2.tar.gz-建立配置文件初始化数据库/varrootlocalhost mysql-5.0.56# /usr/local/mysql/bin/mysql_install_db -user=mysql修改主目录/usr/loc
2、al/mysql权限,和数据库目录/var权限rootlocalhost mysql# chown -R root:mysql /usr/local/mysql/rootlocalhost mysql# chown -R mysql /usr/local/mysql/var/调整lib 库路径Mysql安装到非标准路径中,所以还需要将mysql 的库文件路径/usr/local/mysql/lib/mysql加入到系统库文件搜索路径中 以便在需要的时候能够自动搜索到。rootlocalhost mysql# echo /usr/local/mysql/lib/mysql/ /etc/ld.so
3、.confrootlocalhost mysql# ldconfigrootlocalhost mysql# cat /etc/ld.so.confinclude ld.so.conf.d/*.conf/usr/local/mysql/lib/mysql/rootlocalhost mysql#启动mysql服务 使用mysqld_safa脚本启动服务rootlocalhost mysql# /usr/local/mysql/bin/mysqld_safe -user=mysql &1 2419rootlocalhost mysql# Starting mysqld daemon with d
4、atabases from /usr/local/mysql/varrootlocalhost mysql# netstat -anpt | grep :3306tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2445/mysqld rootlocalhost mysql#2.将mysqld 添加为系统服务把解压目录下的support-files 中的mysql.server cp到/etc/init.d中 改名为mysqldrootlocalhost mysql# cp /root/mysql-5.0.56/support-files/mysql.server /
5、etc/init.d/mysqldrootlocalhost mysql# chmod +x /etc/init.d/mysqld rootlocalhost mysql# chkconfig -add mysqldrootlocalhost mysql# chkconfig mysqld onrootlocalhost mysql# chkconfig -level 35 mysqld onrootlocalhost mysql# service mysqld restartShutting down MySQLSTOPPING server from pid file /usr/local
6、/mysql/var/localhost.localdomain.pid120304 22:49:27 mysqld ended OK Starting MySQL OK 1+ Done /usr/local/mysql/bin/mysqld_safe -user=mysqlrootlocalhost mysql#为了方便使用mysql命令 可以修改环境变量PATH 把mysql命令存放路径添加进去rootlocalhost mysql# export PATH=$PATH:/usr/local/mysql/bin/rootlocalhost mysql# echo $PATH /usr/ke
7、rberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin/rootlocalhost mysql#编译安装PHP环境1.解压 rootlocalhost # tar jxvf php-5.2.6.tar.bz22.配置& make &make installrootlocalhost php-5.2.6# ./configure -prefix=/usr/local/php5 -enable-mbstring
8、-with-apxs2=/usr/local/apache2/bin/apxs -with-mysql=/usr/local/mysql/ -with-config-file-path=/usr/local/php5 & make & make install参数含义:-prefix=/usr/local/php5安装位置-enable-mbstring 设置PHP支持多字节字符串-with-apxs2=/usr/local/apache2/bin/apxs 设置apache 服务器提供的apxs模块支持程序的文件位置 其中apxs2 中的2表示apache的版本-with-mysql=/us
9、r/local/mysql/ 和mysql 进行关联 ,指定mysql的安装位置-with-config-file-path=/usr/local/php5配置文件所在的位置3.建立配置文件rootlocalhost php-5.2.6# cp php.ini-dist /usr/local/php5/php.inirootlocalhost php-5.2.6#4.设置httpd.conf文件用于php和apache协同工作调整首页文档,添加index.php类型重启apache服务rootlocalhost php-5.2.6# /usr/local/apache2/bin/apachec
10、tl restartrootlocalhost php-5.2.6#测试PHP与APACHE协同工作关闭防火墙和SElinux 或者清空规则rootlocalhost php-5.2.6# iptables -Frootlocalhost php-5.2.6#新建测试文件rootlocalhost htdocs# vim test.php查看验证测试PHP与mysql协同工作rootlocalhost htdocs# vim testdb.php查验验证使用LAMP平台假设Discuz!论坛首先建立用于bbs 论坛的数据库及用户rootlocalhost htdocs# mysql -u ro
11、otWelcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 3Server version: 5.0.56-log Source distributionType help; or h for help. Type c to clear the buffer.mysql create database bbsdb;Query OK, 1 row affected (0.00 sec)mysql GRANT all ON bbsdb.* TO runbbslocalhost IDENTI
12、FIED BY 123;Query OK, 0 rows affected (0.00 sec)mysql QUITBye解压下载的软件包,上传程序文件到网页根目录使用的是Discuz_X2_SC_UTF8.zip UCenter_1.6.0_SC_UTF8.zip两个源码包rootlocalhost # unzip Discuz_X2_SC_UTF8.zip -d discuzrootlocalhost # unzip UCenter_1.6.0_SC_UTF8.zip -d ucrootlocalhost # mv discuz/upload/ /usr/local/apache2/htd
13、ocs/bbsrootlocalhost # mv uc/upload/ /usr/local/apache2/htdocs/ucenter设置相关目录的文件的属主,以便httpd 服务能够对论坛写入数据先安装Ucenterrootlocalhost ucenter# chown -R daemon ./data/rootlocalhost ucenter# ll ./data/total 28drwxr-xr-x 2 daemon root 4096 May 20 2011 avatardrwxr-xr-x 2 daemon root 4096 May 20 2011 backupdrwxr
14、-xr-x 2 daemon root 4096 May 20 2011 cache-rw-r-r- 1 daemon root 1 May 20 2011 index.htmdrwxr-xr-x 2 daemon root 4096 May 20 2011 logsdrwxr-xr-x 2 daemon root 4096 May 20 2011 tmpdrwxr-xr-x 2 daemon root 4096 May 20 2011 viewrootlocalhost ucenter#接着安装BBSrootlocalhostbbs#chown -R daemon ./config/ ./d
15、ata/ ./uc_client/data/cache/ ./uc_server/data/安装PHP-Myadmin数据库管理套件解压并上传到网站根目录rootlocalhost # tar zxvf phpMyAdmin-2.11.9.5-all-languages.tar.gzrootlocalhost # mv phpMyAdmin-2.11.9.5-all-languages /usr/local/apache2/htdocs/phpmyadmin建立配置文件rootlocalhost # cd /usr/local/apache2/htdocs/phpmyadmin/rootloc
16、alhost phpmyadmin# cp config.sample.inc.php config.inc.phprootlocalhost phpmyadmin# vim config.inc.php$cfgblowfish_secret = aptech1!; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */必须使用强密码登录时使用数据库密码编译安装postfix创建运行postfix 服务的用户 组rootlocalhost phpmyadmin# groupadd -g 1200 postdroprootlocalhost phpmyadmin
17、# groupadd -g 1000 postfixrootlocalhost phpmyadmin# useradd -M -u 1000 -g postfix -G postdrop -s /sbin/nologin postfixrootlocalhost phpmyadmin#解压释放源码包 合并补丁包rootlocalhost # tar zxvf postfix-2.4.6.tar.gzrootlocalhost # gunzip postfix-2.4.6-vda-ng.patch.gz rootlocalhost # cd postfix-2.4.6rootlocalhost
18、postfix-2.4.6# patch -p1 /etc/postfix/main2.cf 、rootlocalhost etc# mv /etc/postfix/main.cf /etc/postfix/main.cf.bakrootlocalhost etc# mv /etc/postfix/main2.cf /etc/postfix/main.cfrootlocalhost etc# cat /etc/postfix/main.cfcommand_directory = /usr/sbinconfig_directory = /etc/postfixdaemon_directory =
19、 /usr/libexec/postfixdebug_peer_level = 2html_directory = nomail_owner = postfixmailq_path = /usr/bin/mailqmanpage_directory = /usr/local/mannewaliases_path = /usr/bin/newaliasesqueue_directory = /var/spool/postfixreadme_directory = nosample_directory = /etc/postfixsendmail_path = /usr/sbin/sendmail
20、setgid_group = postdropunknown_local_recipient_reject_code = 550postfix 启动控制rootlocalhost etc# postfix start 开启服务postfix/postfix-script: starting the Postfix mail systemrootlocalhost etc# netstat -anpt | grep :25tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 20306/master 没有restart 选项 rootlocalhost etc# postfix
21、 stop 停止服务postfix/postfix-script: stopping the Postfix mail systemrootlocalhost etc# netstat -anpt | grep :25rootlocalhost etc# postfix check 检查配置文件rootlocalhost etc# postfix reload 重新加载postfix/postfix-script: fatal: the Postfix mail system is not runningrootlocalhost etc#编辑配置文件实现简单的电子邮件系统rootlocalh
22、ost etc# vim /etc/postfix/main.cfinet_interfaces = 192.168.10.1myhostname = mydomain = myorigin = $mydomainmydestination = $mydomain, $myhostnamehome_mailbox = Maildir/配置项介绍现在postfix可以发送邮件了, docecot 可以收取邮件组成完整的邮件系统编译安装dovecot创建运行dovecot的用户rootlocalhost etc# useradd -M -s /sbin/nologin dovecot解压配置编译安
23、装rootlocalhost etc# tar zxvf /dovecot-1.1.4.tar.gzrootlocalhost etc# cd dovecot-1.1.4/rootlocalhost dovecot-1.1.4# ./configure -sysconfdir=/etc/ -with-mysql & make & make install-sysconfdir=/etc/ 设置配置文件目录-with-mysql 设置dovecot 支持数据库配置dovecot 运行参数rootlocalhost dovecot-1.1.4# cp /etc/dovecot-example.co
24、nf /etc/dovecot.confrootlocalhost dovecot-1.1.4# vim /etc/dovecot.confssl_disable = yes 禁用ssl 机制protocols = imap pop3 指定支持的协议disable_plaintext_auth = no 不允许明文密码验证mail_location = maildir:/Maildir 设置邮件存储格式和位置 宿主目录下创建PAM认证文件rootlocalhost dovecot-1.1.4# vim /etc/pam.d/dovecotauth required pam_nologin.so
25、auth include system-authaccount include system-authsession include system-auth启动dovecot 服务,并验证其监听TCP端口rootlocalhost dovecot-1.1.4# dovecotrootlocalhost dovecot-1.1.4# netstat -anpt | grep dovecottcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 10261/dovecot tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 10261/dovecot roo
26、tlocalhost dovecot-1.1.4#OE验证Webmail接收搭建Webmail邮件界面解压 上传到网站根目录rootlocalhost # tar jxvf squirrelmail-1.4.13.tar.bz2rootlocalhost # mv squirrelmail-1.4.13 /usr/local/apache2/htdocs/webmailrootlocalhost # cd /usr/local/apache2/htdocs/webmail/ 解压中文语言包rootlocalhost webmail# tar jxvf /zh_CN-1.4.13-20071220.tar.bz2 创建及调整数据目录、附件目录rootlocalhost webmail# mkdir -p attach datarootlocalhost webmail# chown -R daemon:daemon attach/ data/rootlocalhost webmail# c
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1