cd httpd-2.4.27/
./configure --prefix=/app/httpd24 --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-rewrite --with-zlib--with-pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork
make -j 4 && make install
vim /etc/profile.d/lamp.sh
PATH=/app/httpd24/bin/:$PATH
. /etc/profile.d/lamp.sh
apachectl
ss -tnl
2 . centos7 : 二进制安装mariadb
数据库必须放在指定的文件夹下tar xvf mariadb-10.2.8-linux-x86_64.tar.gz -C/usr/local/
cd /usr/local
ln -s mariadb-10.2.8-linux-x86_64/ mysql
若没有mysql用户就要添加 useradd -r -m -d /app/mysqldb -s /sbin/nologin mysql
cd mysql/
scripts/mysql_install_db--datadir=/app/mysqldb --user=mysql
mkdir /etc/mysql
cp support-files/my-large.cnf /etc/mysql/my.cnf
vim /etc/mysql/my.cnf
[mysqld]
datadir = /app/mysqldb
innodb_file_per_table = ON
skip_name_resolve = ON
cp support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --list
service mysqld start
mkdir /var/log/mariadb
chown mysql /var/log/mariadb/
service mysqld start
因为数据库在/usr/local/,使用起来不方便,所以把它写入变量。vim /etc/profile.d/lamp.sh
PATH=/app/httpd24/bin/:/usr/local/mysql/bin/:$PATH
. /etc/profile.d/lamp.sh
mysql_secure_installation
mysql -uroot -pcentos
create datebase wpdb;
grant all on wpdb.* towpuser@'192.168.25.%' identified by 'centos';