1.http://httpd.apache.org/
在官网下载apache
2.执行解压命令:tar -zxvf httpd-2.24.tar.gz
进入到解压目录执行sudo ./configure
3.会提示apr not found
1)这时可以用 ./configure --help |grep apr 来查看帮助
apr(apache portable runtime) apr-util 都未指定
到官网下载apr 解压后 安装执行sudo ./configure 默认安装在/usr/local/apr目录下
sudo make
sudo make install
2)安装完后仍可能提示 apr-util not found
到官网下载 apr-util 包
sudo ./configure --with-apr=/usr/local/apr
#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
sudo make
sudo make install
3)安装pcre
到官网下载pcre包
sudo ./configure --with-apr-util=/usr/local/apr-util
#./configure --prefix=/usr/local/pcre
sudo make
sudo make install
继续安装Apache/httpd,./configure 时加上参数 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre,这个问题就解决了
注意:Apache在安装时不会检查参数是否正确,错误的参数会直接被丢弃,不会报告给用户。但可以使用echo $?命令检查是否有错误,当输出结果为0时表示没有错误。
#echo $?
0
#make
#make install
http://www.cnblogs.com/JemBai/archive/2012/11/07/2759139.html
#ps -e |grep httpd 查看启动
安装好apache后无法启动,出现如下错误:
error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
# ldd /usr/local/apache/bin/httpd
会看到这么一行
libiconv.so.2 => Not found
以前编译运行是可以的,可能是不久前升级了iconv库影响。在/usr/local/lib下可以找到libiconv.so.2,把/usr/local/lib加到路径中也不行。
方法一:
在/etc/ld.so.conf中加一行/usr/local/lib,运行ldconfig。再运行apache,OK。
ld.so.conf和ldconfig是维护系统动态链接库的。真不明白为什么iconv库安装时不把这一步也做了
方法二:
ln -sf /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2
http://blog.sina.com.cn/s/blog_5b6cb9500100ytm9.html
启动后提示
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
因为没有指定主机名
编辑conf/httpd.conf
把:
# ServerName www.example.com:80
改为:
ServerName localhost:80
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Msql
1.安装cmake
# 检查MySQL服务器系统进程 ~ ps -aux|grep mysql mysql 3205 2.0 0.5 549896 44092 ? Ssl 20:10 0:00 /usr/sbin/mysqld conan 3360 0.0 0.0 11064 928 pts/0 S+ 20:10 0:00 grep --color=auto mysql # 检查MySQL服务器占用端口 ~ netstat -nlt|grep 3306 tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
下载mysql的安装包解压
赋予权限与初始化
$ sudo useradd mysql $ sudo chown -R mysql.mysql /app/mysql/ $ sudo /app/mysql/scripts/mysql_install_db --basedir=/app/mysql --datadir=/app/mysql/data --user=mysql
启动
$ sudo /app/mysql/bin/mysqld_safe & [1] 2255$ 150204 09:30:14 mysqld_safe Logging to '/app/mysql/data/ubuntu.err'.150204 09:30:14 mysqld_safe Starting mysqld daemon with databases from /app/mysql/data
赋予权限与初始化
$ sudo useradd mysql $ sudo chown -R mysql.mysql /app/mysql/ $ sudo /app/mysql/scripts/mysql_install_db --basedir=/app/mysql --datadir=/app/mysql/data --user=mysql
启动
$ sudo /app/mysql/bin/mysqld_safe & [1] 2255$ 150204 09:30:14 mysqld_safe Logging to '/app/mysql/data/ubuntu.err'.150204 09:30:14 mysqld_safe Starting mysqld daemon with databases from /app/mysql/data
赋予权限与初始化
$ sudo useradd mysql $ sudo chown -R mysql.mysql /app/mysql/ $ sudo /app/mysql/scripts/mysql_install_db --basedir=/app/mysql --datadir=/app/mysql/data --user=mysql
启动
$ sudo /app/mysql/bin/mysqld_safe & [1] 2255$ 150204 09:30:14 mysqld_safe Logging to '/app/mysql/data/ubuntu.err'.150204 09:30:14 mysqld_safe Starting mysqld daemon with databases from /app/mysql/data
赋予权限与初始化
$ sudo useradd mysql $ sudo chown -R mysql.mysql /app/mysql/ $ sudo /app/mysql/scripts/mysql_install_db --basedir=/app/mysql --datadir=/app/mysql/data --user=mysql
启动
$ sudo /app/mysql/bin/mysqld_safe & [1] 2255$ 150204 09:30:14 mysqld_safe Logging to '/app/mysql/data/ubuntu.err'.150204 09:30:14 mysqld_safe Starting mysqld daemon with databases from /app/mysql/data
赋予权限与初始化
$ sudo useradd mysql $ sudo chown -R mysql.mysql /app/mysql/ $ sudo /app/mysql/scripts/mysql_install_db --basedir=/app/mysql --datadir=/app/mysql/data --user=mysql
启动
$ sudo /app/mysql/bin/mysqld_safe & [1] 2255$ 150204 09:30:14 mysqld_safe Logging to '/app/mysql/data/ubuntu.err'.150204 09:30:14 mysqld_safe Starting mysqld daemon with databases from /app/mysql/data
端口已经监听,已经成功安装并启动。