新服务器完整搭建www环境过程_MySQL
很久不搭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
基本上整个安装过程就是这样。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solution: 1. Check the eMule settings to make sure you have entered the correct server address and port number; 2. Check the network connection, make sure the computer is connected to the Internet, and reset the router; 3. Check whether the server is online. If your settings are If there is no problem with the network connection, you need to check whether the server is online; 4. Update the eMule version, visit the eMule official website, and download the latest version of the eMule software; 5. Seek help.

As a LINUX user, we often need to install various software and servers on CentOS. This article will introduce in detail how to install fuse and set up a server on CentOS to help you complete the related operations smoothly. CentOS installation fuseFuse is a user space file system framework that allows unprivileged users to access and operate the file system through a customized file system. Installing fuse on CentOS is very simple, just follow the following steps: 1. Open the terminal and Log in as root user. 2. Use the following command to install the fuse package: ```yuminstallfuse3. Confirm the prompts during the installation process and enter `y` to continue. 4. Installation completed

What should I do if the RPC server is unavailable and cannot be accessed on the desktop? In recent years, computers and the Internet have penetrated into every corner of our lives. As a technology for centralized computing and resource sharing, Remote Procedure Call (RPC) plays a vital role in network communication. However, sometimes we may encounter a situation where the RPC server is unavailable, resulting in the inability to enter the desktop. This article will describe some of the possible causes of this problem and provide solutions. First, we need to understand why the RPC server is unavailable. RPC server is a

In network data transmission, IP proxy servers play an important role, helping users hide their real IP addresses, protect privacy, and improve access speeds. In this article, we will introduce the best practice guide on how to build an IP proxy server with PHP and provide specific code examples. What is an IP proxy server? An IP proxy server is an intermediate server located between the user and the target server. It acts as a transfer station between the user and the target server, forwarding the user's requests and responses. By using an IP proxy server

According to news from this site on July 23, Lenovo’s YOGA Portal high-performance desktop computer, which has been exposed for a long time, is now confirmed to be officially released at ChinaJoy in Shanghai on July 27. It is claimed to be a mini host designed for professional AI creation. It is a performance master and an expert in AI creation of 3D digital people. The AI virtual background is based on the on-site pictures provided by our friend @yuP in Shanghai. The volume of this small host is only 3.7L. It is made of anodized aluminum and is equipped with Intel Core. i7-14700 processor, equipped with 32GBDDR5 memory and 1TB solid state drive. YOGA Portal is both a host and an all-in-one AI creation machine. The high-performance host is combined with an algorithm-optimized camera to form an integrated solution. Just stand in front of the camera i.e.

According to news from this site on June 5, MSI participated in the 2024 Taipei International Computer Show and showcased a new flagship gaming computer called MEGVisionXAI. This game console is an extension of the existing Vision series and uses a very eye-catching surround glass design, with internal components clearly visible. The most attractive part is that the front of the host is equipped with an oversized touch screen. MSI staff said that it can synchronize MSI’s exclusive AI applications to further enhance various AI functions. The relevant pictures attached to this site are as follows: MSI has not yet explained more details. From the pictures shared, you can see that a local AI chatbot is running on the screen. Users can interact with it and ask it to complete AI tasks and locate locally stored documents. wait. Source of the above picture:

The role of a DHCP relay is to forward received DHCP packets to another DHCP server on the network, even if the two servers are on different subnets. By using a DHCP relay, you can deploy a centralized DHCP server in the network center and use it to dynamically assign IP addresses to all network subnets/VLANs. Dnsmasq is a commonly used DNS and DHCP protocol server that can be configured as a DHCP relay server to help manage dynamic host configurations in the network. In this article, we will show you how to configure dnsmasq as a DHCP relay server. Content Topics: Network Topology Configuring Static IP Addresses on a DHCP Relay D on a Centralized DHCP Server

What should I do if I can’t enter the game when the epic server is offline? This problem must have been encountered by many friends. When this prompt appears, the genuine game cannot be started. This problem is usually caused by interference from the network and security software. So how should it be solved? The editor of this issue will explain I would like to share the solution with you, I hope today’s software tutorial can help you solve the problem. What to do if the epic server cannot enter the game when it is offline: 1. It may be interfered by security software. Close the game platform and security software and then restart. 2. The second is that the network fluctuates too much. Try restarting the router to see if it works. If the conditions are OK, you can try to use the 5g mobile network to operate. 3. Then there may be more
