Linux下Apache随机启动 cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apached chmod +x /etc/rc.d/init.d/ap
Apache源于NCSAhttpd服务器,经过多次修改,成为世界上最流行的Web服务器软件之一。Apache取自“a patchy server”的读音,意思是充满补丁的服务器,因为它是自由软件,所以不断有人来为它开发新的功能、新的特性、修改原来的缺陷。Apache的特点是简单、速度快、性能稳定,,并可做代理服务器来使用。
Linux下Apache随机启动
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apached
chmod +x /etc/rc.d/init.d/apached
ln -s /etc/rc.d/init.d/apached /etc/rc3.d/S100apache
ln -s /etc/rc.d/init.d/apached /etc/rc0.d/K100apache
mysql随机启动
默认配置
cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysql
chmod +x /etc/rc.d/init.d/mysql
ln -s /etc/rc.d/init.d/mysql /etc/rc3.d/S100mysql
ln -s /etc/rc.d/init.d/mysql /etc/rc0.d/K100mysql
非默认安装 比如配置在/opt/mysql_server中 创建启动文件/opt/mysql_server/start.sh
#!/bin/sh
rundir="/opt/mysql_server";
echo $rundir;
/usr/local/mysql/bin/mysqld_safe --defaults-file="$rundir"/my.cnf --pid-file="$rundir"/mysql.pid --datadir="$rundir"/data --socket="$rundir"/mysql.sock --user=mysql --log-error="$rundir"/error.log --log-slow-queries="$rundir"/slow_query.log&
创建停止文件/opt/mysql_server/stop.sh
#!/bin/sh
rundir="/opt/mysql_server";
echo $rundir;
/usr/local/mysql/bin/mysqladmin -uroot -pctech --socket="$rundir"/mysql.sock shutdown
创建配置文件my.cnf
[mysqld]
port = 8211
skip-locking
skip-innodb
skip-name-resolve
set-variable = back_log=600
set-variable = key_buffer=4M
set-variable = max_allowed_packet=2M
set-variable = table_cache=512
set-variable = sort_buffer=16M
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号