标签:
tar -zxvf mysql
addUser mysql -s /sbin/nologin
mv mysql /usr/local/mysql (改目录下直接存储bin docs等目录)
mkdir -p /data/mysql
chown -R mysql:mysql /data/mysql
cd /usr/local/mysql
./scripts/mysql_install_db --user=mysql --datadir=/data/mysql(ok ok )
echo $? 是否是0
ls /data/mysql/
cd support-files/
cp my-medium.cnf /etc/my.cnf overload
vim my.cnf
port =3306
socket =/tmp/mysql.sock
skip-networking (关闭网络3306端口)
注释关闭 (主从时会用到)
log-bin= mysql-bin (是否开启二进制日志)
binlog_format=mixed
server-id =1
cp mysql.server /etc/init.d/mysqld
vi !$
basedir=/usr/local/mysql
datadir=/data/mysql
chkconfig (系统服务列表)
chkconfig --add mysqld
chkconfig mysqld on
/etc/init.d/mysqld start
ps aux|grep mysql (检查是否启动)
netstat -lnp (检查端口3306)
mysql 安装完毕
Apache 开始安装
cd
cd /usr/local/src/
tar -zxvf httpd-2.2.16.tar.gz
cd httpd-2.2.16
vim INSTALL prefix make make install
./configure --prefix=/usr/local/apache2 --enable-mods-shared=most (动态加静态加载:) --enable-so (dso 动态加载 补充安装)
echo $?
make
echo $?
make install
cd /usr/local/apache2
ls modules/ (动态加载模块)
apache 安装完毕
/usr/local/apache2/bin/httpd -t 检测配置文件是否有问题 syntax OK
/usr/local/apache2/bin/httpd -l 静态加载模块或者功能
core 核心
prefork 工作模式
http_core
mod_so
/usr/local/src/httpd-2.2.16/ configure --help
--with-mpm=MPM event|worker(进程和线程)|prefork(父进程子进程)
/usr/local/apache2/bin/httpd -M 列出加载模块
cat /usr/local/apache2/build/config.nice(查看编译时参数)
/usr/local/apache2/bin/apachectl start|stop
ps aux|grep httpd
netstat -lnp
vi conf/httpd.conf
serverName www.example.com 注销去掉
./bin/apachectl -t | ./bin/httpd -t 测试配置文件
./bin/apachectl graceful (reload)
curl localhost 检测 或者 ip访问 It works
标签:
原文地址:http://www.cnblogs.com/LinuxSuDa/p/5764631.html