设为首页 收藏本站
查看: 711|回复: 0

LAMP第一部分-环境搭建

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-9-6 09:21:05 | 显示全部楼层 |阅读模式
手动安装
  准备工作  
  关闭 selinux
  清空  iptables
  1. 安装mysql   
cd /usr/local/src/   
wget http://mirrors.sohu.com/mysql/My ... 6_64-glibc23.tar.gz   
tar zxvf  mysql-5.1.72-linux-x86_64-glibc23.tar.gz   
mv     mysql-5.1.72-linux-x86_64-glibc23  /usr/local/mysql   
useradd -s /sbin/nologin mysql   
cd /usr/local/mysql   
mkdir -p /data/mysql   
chown -R mysql:mysql /data/mysql
  cd  /usr/local/mysql   
./scripts/mysql_install_db --user=mysql --datadir=/data/mysql
  (pwd  :/usr/local/mysql)
  报错:http://www.plob.org/2011/03/10/78.html  安装 epel-release libmcrypt-devel  libaio pcre-devel perl libxml2-devel openssl-devel bzip2-devel freetype-devel libjpeg-devel libpng-devel compat-libstdc*
  [root@wuhan-242 mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql  
WARNING: The host 'wuhan-242' 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 will not work.   
This means that you should use IP addresses instead of hostnames   
when specifying MySQL privileges !   
Installing MySQL system tables...   
OK   
Filling help tables...   
OK
  [root@centos-03 httpd-2.2.29]# echo  $?   
0   
cp support-files/my-large.cnf /etc/my.cnf   
cp support-files/mysql.server /etc/init.d/mysqld   
chmod 755 /etc/init.d/mysqld   
vim /etc/init.d/mysqld   
  #修改
  basedir=/usr/local/mysql
  datadir=/data/mysql
  chkconfig --add mysqld   
chkconfig mysqld on   
/etc/init.d/mysqld start
  Starting MySQL ERROR! Couldn't find MySQL manager (/usr/local/mysql/bin/mysqlmanager) or server (/usr/local/mysql/bin/mysqld_safe)   
mv  时  文件移动不对   
检查  mysqlmanager  所在的pwd   
测试   
netstat  -lnp |grep  3306   
2. 安装apache   
pwd  :  /usr/local/src/
  wget   http://archive.apache.org/dist/httpd/httpd-2.2.16.tar.gz   
tar zvxf httpd-2.2.16.tar.gz   
cd httpd-2.2.29   
./configure --prefix=/usr/local/apache2  --enable-mods-shared=most  --enable-so
  [root@centos-03 httpd-2.2.29]# echo  $?   
0
  configure:error: in `/usr/local/src/httpd-2.2.21/srclib/apr':
  configure:error: no acceptable C compiler found in $PATH
  See `config.log'for more details.
  执行./configure时,可能会遇到以上错误,这个主要是gcc包没有安装。对于这个问题,使用 yum  install gcc就可以了。
  make && make install
  service  httpd  start
  [root@localhost httpd-2.2.29]# service  httpd  start   
httpd: 未被识别的服务
  /usr/local/apache2/bin/apachectl start
  http://blog.sina.com.cn/s/blog_5093fd500101bzk4.html
  httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
  [  OK  ]
  http://www.cnblogs.com/52linux/archive/2012/03/24/2415637.html
   /etc/httpd/conf/httpd.conf  
  /usr/local/apache2/conf/httpd.conf
  将里面的 #ServerName localhost:80 注释去掉即可。
  [root@sun httpd-2.2.29]# service  httpd  restart   
Stopping httpd: [  OK  ]   
Starting httpd: [  OK  ]
  测试   浏览器 输入  111.47.123.72
   wKiom1XoNrWSG7OAAAA09jvyPrc113.jpg
   wKiom1XoNrXBcj_5AAAsCG_aTjM783.jpg
  ps  aux |grep  httpd
  netstat  -lnp |grep  80   
3.  安装php
  pwd  :  /usr/local/src/
  wget http://mirrors.sohu.com/php/php-5.3.29.tar.gz   
tar zxf php-5.3.29.tar.gz   
cd php-5.3.28   
./configure   --prefix=/usr/local/php   --with-apxs2=/usr/local/apache2/bin/apxs   --with-config-file-path=/usr/local/php/etc   --with-mysql=/usr/local/mysql   --with-libxml-dir   --with-gd   --with-jpeg-dir   --with-png-dir   --with-freetype-dir   --with-iconv-dir   --with-zlib-dir   --with-bz2   --with-openssl   --with-mcrypt   --enable-soap   --enable-gd-native-ttf   --enable-mbstring   --enable-sockets   --enable-exif   --disable-ipv6   
echo  $?
  1
  configure: error: xml2-config not found. Please check your libxml2 installation.
  configure: error: Cannot find OpenSSL's <evp.h>
  configure: error: Please reinstall the BZip2 distribution
  configure: error: jpeglib.h not found.
  [root@sun php-5.3.28]# yum  install   -y   libxml2*
  [root@sun php-5.3.28]# yum install -y  bzip2*
  [root@sun php-5.3.28]# yum install -y  openssl-dev*
  [root@sun php-5.3.28]# yum install -y  libmcrypt*
  (yum install libxml2-devel  libjpeg-*  libpng-devel freetype-devel gd-devel libmcrypt-devel openssl-devel  bzip2*)
  解决
  yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
  http://blog.iyunv.com/default7/article/details/32312061   
echo  $?   
make && make install
  /usr/bin/ld: cannot find -lltdl
  collect2: ld returned 1 exit status
  make: *** [libphp5.la] 错误 1   
http://blog.sina.com.cn/s/blog_65d94e4c010195ys.html   
Thank you for using PHP.   
4. 配置apache结合php   
vim /usr/local/apache2/conf/httpd.conf   
找到:   
AddType application/x-gzip .gz .tgz   
在该行下面添加:   
AddType application/x-httpd-php .php   
找到:   
<IfModule dir_module>   
    DirectoryIndex index.html   
</IfModule>   
将该行改为:   
<IfModule dir_module>   
    DirectoryIndex index.html index.htm index.php   
</IfModule>   
找到:   
#ServerName www.example.com:80   
修改为:   
ServerName localhost:80
  [root@localhost htdocs]# /usr/local/apache2/bin/apachectl -t   
Syntax OK   
5. 测试解析php   
vim /usr/local/apache2/htdocs/1.php   
写入:   
<?php   
    echo "php解析正常";   
?>   
保存后,继续测试:   
curl localhost/1.php
   wKiom1XoNrbD_zxHAAB-x7AFBzw374.jpg
  [root@sun htdocs]# /usr/local/apache2/bin/apachectl restart   
httpd not running, trying to start   
(98)Address already in use: make_sock: could not bind to address [::]:80   
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80   
no listening sockets available, shutting down   
Unable to open logs   
http://blog.sina.com.cn/s/blog_637e04c901011bmm.html
  vi /etc/services   查看 端口号   



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-109979-1-1.html 上篇帖子: yum安装lamp+discuz 下篇帖子: LAMP第二部分apache配置 discuz
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表