很久不搭www环境了,几乎都要忘了,而且各种新版本,各种新参数。前段时间用金山云的主机,速度蛮不错的,可惜备案过程是相当纠结,导致了本博被墙了一个多礼拜,狠狠心重新在西部数码买了一台,所以又要重新搭环境。之前搭环境有记录编辑参数,没记录具体步骤,这次干脆把从前到后所有步骤记录下来,以后操作也方便。懒人改变世界!
搜索rpmforge包
下载对应系统版本的rpmforge#rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
#rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm
#rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm
检查系统环境,更新软件库,安装依赖#chkconfig --list
#chkconfig --del mysql
#chkconfig --del httpd
#rpm -qa | grep http
#rpm -e httpd
#rpm -qa | grep apache
#rpm -e apache
#rpm -qa | grep php
#rpm -e php
#rpm -qa | grep mysql
#rpm -e mysql
#yum -y remove httpd*
#yum -y remove mysql*
#yum -y remove php*
#yum update
#yum install patch make gcc gcc-c++ automake cmake autoconf kernel-devel libtool libtool-libs libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel glibc glibc-devel glibc-headers glibc-static glibc-utils openssl openssl-devel crypto-utils gettext gettext-devel ncurses ncurses-devel gmp-devel aspell aspell-devel perl-IO-Compress-Base perl-HTML-Parser perl-ExtUtils-MakeMaker perl-libwww-perl perl-Pod-Escapes perl-Module-Pluggable perl-libs perl-ExtUtils-FindFunctions perl-Compress-Raw-Zlib perl-IO-Compress-Zlib perl-Test-Harness perl-ExtUtils-ParseXS perl-Newt perl-HTML-Tagset perl-URI perl-Convert-ASN1 perl-ExtUtils-Embed perl-Pod-Simple perl-ExtUtils-DynaGlue perl-Compress-Zlib perl-devel perl-DBI gd gd-devel curl libcurl libcurl-devel readline readline-devel
添加对应用户#groupadd mysql
#useradd -g mysql -s /sbin/nologin mysql
#groupadd www
#useradd -g www -s /home/www www
安装mysql
#cmake /-DCMAKE_INSTALL_PREFIX=/usr/local/mysql /-DSYSCONFDIR=/etc /-DMYSQL_DATADIR=/home/mysql /-DEXTRA_CHARSETS=all /-DDEFAULT_CHARSET=utf8 /-DDEFAULT_COLLATION=utf8_general_ci /-DENABLED_LOCAL_INFILE=1 /-DWITH_MYISAM_STORAGE_ENGINE=1 /-DWITH_INNOBASE_STORAGE_ENGINE=1 /-DWITH_READLINE=1 /-DWITH_DEBUG=0 /-DMYSQL_TCP_PORT=3306 /-DMYSQL_USER=mysql /-DWITH_SSL=yes /-DENABLE_DOWNLOADS=1
#make && make install
#vim /etc/ld.so.conf
+/usr/local/mysql/lib
#ldconfig
#cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
#cp /usr/local/mysql/support-files/my-large.cnf /etc/my.cnf
#vim /etc/profile
找到# Path manipulation行,在if内部添加pathmunge /usr/local/mysql/bin
#cd /usr/local/mysql && ./scripts/mysql_install_db --user=mysql
#/etc/init.d/mysqld restart
#chkconfig --add mysqld
#cd /usr/local/mysql && ./bin/mysql_secure_installation
安装libiconv#./configure && make && make install
安装mhash#./configure && make && make install
安装libmcrypt#./configure && make && make install
安装mcrypt#./configure && make && make install
安装pcre#./configure && make && make install
安装nginx
#./configure /--prefix=/usr/local/nginx /--user=www /--group=www /--with-select_module /--with-poll_module /--with-http_ssl_module /--with-http_realip_module /--with-http_image_filter_module /--with-http_sub_module /--with-http_dav_module /--with-http_gunzip_module /--with-http_gzip_static_module /--with-http_random_index_module /--with-http_secure_link_module /--with-pcre /--without-http_uwsgi_module /--without-http_scgi_module /--without-http_geo_module /--without-http_map_module /--without-mail_pop3_module /--without-mail_imap_module /--without-mail_smtp_module /--with-http_perl_module
#make && make install
修改配置
与mysql类似的方法,添加下面内容pathmunge /usr/local/nginx/sbin
nginx启动脚本
#!/bin/sh## nginx - this script starts and stops the nginx daemon## chkconfig: - 85 15 # description:Nginx is an HTTP(S) server, HTTP(S) reverse /# proxy and IMAP/POP3 proxy server# processname: nginx# config: /etc/nginx/nginx.conf# config: /etc/sysconfig/nginx# pidfile: /var/run/nginx.pid# Source function library.. /etc/rc.d/init.d/functions# Source networking configuration.. /etc/sysconfig/network# Check that networking is up.[ "$NETWORKING" = "no" ] && exit 0nginx="/usr/local/nginx/sbin/nginx"prog=$(basename $nginx)NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginxlockfile=/var/lock/subsys/nginxmake_dirs() { # make required directories user=`$nginx -V 2>&1 | grep "configure arguments:" | sed 's/[^*]*--user=/([^ ]*/).*//1/g' -` if [ -z "`grep $user /etc/passwd`" ]; then useradd -M -s /bin/nologin $user fi options=`$nginx -V 2>&1 | grep 'configure arguments:'` for opt in $options; do if [ `echo $opt | grep '.*-temp-path'` ]; then value=`echo $opt | cut -d "=" -f 2` if [ ! -d "$value" ]; then # echo "creating" $value mkdir -p $value && chown -R $user $value fi fi done}start() { [ -x $nginx ] || exit 5 [ -f $NGINX_CONF_FILE ] || exit 6 make_dirs echo -n $"Starting $prog: " daemon $nginx -c $NGINX_CONF_FILE retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval}stop() { echo -n $"Stopping $prog: " killproc $prog -QUIT retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval}restart() { configtest || return $? stop sleep 1 start}reload() { configtest || return $? echo -n $"Reloading $prog: " killproc $nginx -HUP RETVAL=$? echo}force_reload() { restart}configtest() {$nginx -t -c $NGINX_CONF_FILE}rh_status() { status $prog}rh_status_q() { rh_status >/dev/null 2>&1}case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart|configtest) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}" exit 2esac
安装php
#./configure /--prefix=/usr/local/php /--enable-fpm /--with-fpm-user=www /--with-fpm-group=www /--with-config-file-path=/usr/local/php/etc /--disable-ipv6 /--with-openssl /--with-zlib /--enable-bcmath /--with-bz2 /--enable-calendar /--with-curl /--with-libxml-dir=/usr /--enable-exif /--with-pcre-dir=/usr/local /--enable-ftp /--with-gd /--with-jpeg-dir /--with-png-dir /--with-freetype-dir /--enable-gd-native-ttf /--with-gettext /--with-mhash /--enable-mbstring /--with-mcrypt /--with-mysql=/usr/local/mysql /--with-mysql-sock=/tmp/mysql.sock /--with-mysqli=/usr/local/mysql/bin/mysql_config /--with-pdo-mysql=/usr/local/mysql /--with-pspell /--with-readline=/usr /--enable-soap /--enable-sockets /--enable-sysvmsg /--enable-sysvsem /--enable-sysvshm /--with-xmlrpc /--with-iconv=/usr/local /--enable-zip /--with-pear /--without-sqlite3 /--without-pdo-sqlite
#make && make install``
#cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm#cp /root/phpsrc/php.ini-product /usr/local/php/etc/php.ini`
与mysql类似方法,添加下面的内容pathmunge /usr/local/php/bin
memcache配置#phpize
#./configure /--enable-memcache /--with-php-config=/usr/local/php/bin/php-config
memcached配置./configure --prefix=/usr/local/memcache --enable-64bit
基本上整个安装过程就是这样。

DHCP是“动态主机配置协议DynamicHostConfigurationProtocol”的首字母缩写词,它是一种网络协议,可自动为计算机网络中的客户端系统分配IP地址。它从DHCP池或在其配置中指定的IP地址范围分配客户端。虽然你可以手动为客户端系统分配静态IP,但DHCP服务器简化了这一过程,并为网络上的客户端系统动态分配IP地址。在本文中,我们将演示如何在RHEL9/RockyLinux9上安装和配置DHCP服务器。先决条件预装RHEL9或RockyLinux9具有sudo管理权限的普

一、安装nginx容器为了让nginx支持文件上传,需要下载并运行带有nginx-upload-module模块的容器:sudopodmanpulldocker.io/dimka2014/nginx-upload-with-progress-modules:latestsudopodman-d--namenginx-p83:80docker.io/dimka2014/nginx-upload-with-progress-modules该容器同时带有nginx-upload-module模块和ng

1,将java项目打成jar包这里我用到的是maven工具这里有两个项目,打包完成后一个为demo.jar,另一个为jst.jar2.准备工具1.服务器2.域名(注:经过备案)3.xshell用于连接服务器4.winscp(注:视图工具,用于传输jar)3.将jar包传入服务器直接拖动即可3.使用xshell运行jar包注:(服务器的java环境以及maven环境,各位请自行配置,这里不做描述。)cd到jar包路径下执行:nohupjava-jardemo.jar>temp.txt&

vue3项目打包发布到服务器后访问页面显示空白1、处理vue.config.js文件中的publicPath处理如下:const{defineConfig}=require('@vue/cli-service')module.exports=defineConfig({publicPath:process.env.NODE_ENV==='production'?'./':'/&

TCP客户端一个使用TCP协议实现可连续对话的客户端示例代码:importsocket#客户端配置HOST='localhost'PORT=12345#创建TCP套接字并连接服务器client_socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)client_socket.connect((HOST,PORT))whileTrue:#获取用户输入message=input("请输入要发送的消息:&

scp是securecopy的简写,是linux系统下基于ssh登陆进行安全的远程文件拷贝命令。scp是加密的,rcp是不加密的,scp是rcp的加强版。因为scp传输是加密的,可能会稍微影响一下速度。另外,scp还非常不占资源,不会提高多少系统负荷,在这一点上,rsync就远远不及它了。虽然rsync比scp会快一点,但当小文件众多的情况下,rsync会导致硬盘I/O非常高,而scp基本不影响系统正常使用。场景:假设我现在有两台服务器(这里的公网ip和内网ip相互传都可以,当然用内网ip相互传

psutil是一个跨平台的Python库,它允许你获取有关系统进程和系统资源使用情况的信息。它支持Windows、Linux、OSX、FreeBSD、OpenBSD和NetBSD等操作系统,并提供了一些非常有用的功能,如:获取系统CPU使用率、内存使用率、磁盘使用率等信息。获取进程列表、进程状态、进程CPU使用率、进程内存使用率、进程IO信息等。杀死进程、发送信号给进程、挂起进程、恢复进程等操作。使用psutil,可以很方便地监控系统的运行状况,诊断问题和优化性能。以下是一个简单的示例,演示如何

一、安装前的准备工作在进行MySQL多实例的安装前,需要进行以下准备工作:准备多个MySQL的安装包,可以从MySQL官网下载适合自己环境的版本进行下载:https://dev.mysql.com/downloads/准备多个MySQL数据目录,可以通过创建不同的目录来支持不同的MySQL实例,例如:/data/mysql1、/data/mysql2等。针对每个MySQL实例,配置一个独立的MySQL用户,该用户拥有对应的MySQL安装路径和数据目录的权限。二、基于二进制包安装多个MySQL实例


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

SublimeText3 Linux新版
SublimeText3 Linux最新版

SublimeText3汉化版
中文版,非常好用

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)