Server Installation configuration document JDK, Apache, MySQL, memcached, Jmagick, Tomcat

Source: Internet
Author: User
Tags imagemagick memcached

Server Installation Configuration Documentation

1.JDK installation (Take Jdk-6u13-linux-x64.bin as an example)
1.1 Download JDK,
1.2 Changing the JDK execution permissions:
chmod 755 Jdk-6u13-linux-x64.bin
1.3 Run the installation file:
./jdk-6u13-linux-x64.bin
1.4 Create Link file:
Ln-s jdk1.6.0_13 JDK
1.5 Deleting the installation files:
RM Jdk-6u13-linux-x64.bin
1.6 Setting Environment variables:
The CD/ETC/PROFILE.D directory executes the VI command to create the java.sh file, which reads as follows:
Java_home=/home/jdk
Classpath=.: $JAVA _home/lib/tools.jar
Path= $JAVA _home/bin: $PATH export java_home CLASSPATH PATH
Change java.sh File Execution permissions: chmod 755 java.sh
Reload: Source/etc/profile
OK, at this point, no unexpected JDK has been installed, you can execute the java-version command to see if the system is recognized, see if the version number is right.

2. Install Apache (take httpd-2.2.11.tar.gz as an example)
2.1 Download Apache Pack
2.2 Unpack the Apache pack:
TAR-XZVF httpd-2.2.11.tar.gz
2.3 Installing Apache Apr
CD HTTPD-2.2.11/SRCLIB/APR
./configure--prefix=/usr/local/apr-httpd/
Make && make install
2.4 Installing Apache Apr-util
CD Httpd-2.2.11/srclib/apr-util
./configure--prefix=/usr/local/apr-util-httpd/--with-apr=/usr/local/apr-httpd/
Make && make install
2.5 Installing Apache
./configure--prefix=/home/apache \
--enable-rewrite=shared \
--enable-proxy=shared \
--enable-speling=shared \
--enable-deflate=shared \
--WITH-APR=/USR/LOCAL/APR-HTTPD \
--WITH-APR-UTIL=/USR/LOCAL/APR-UTIL-HTTPD \
--enable-so
Make && make install
2.6 Deleting the installation files:
RM-RF httpd-2.2.11
2.7 Configuring Apache:
Mainly apache/conf/http.conf files, I put the attention to the place to say:
2.7.1. Listen 80, note that the listener is 80 ports, and can be changed to another port (note to open the 80 port of the firewall)
2.7.2. The component to open:
LoadModule Deflate_module modules/mod_deflate.so
LoadModule Proxy_module modules/mod_proxy.so
#LoadModule Proxy_connect_module modules/mod_proxy_connect.so
#LoadModule Proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule Proxy_http_module modules/mod_proxy_http.so
LoadModule Proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule Proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule Speling_module modules/mod_speling.so
LoadModule Rewrite_module modules/mod_rewrite.so
If you follow the above compilation method, then open these components.
2.7.3. Configuration and Tomcat connection methods, generally now use reverse proxy:
2.7.3.1. The first way:
Can be directly in the http.conf file with:
ServerName esite.member.mysteel.com:80

Proxyrequests OFF

proxypass/http://127.0.0.1:8080/
proxypassreverse/http://127.0.0.1:8080/
Transfer all requests for the esite.member.mysteel.com domain to the Tomcat application under port 8080
2.7.3.2. The second way:
Open the comment that include conf/extra/httpd-vhosts.conf this sentence.
Configure in the extra/httpd-vhosts.conf file:
<virtualhost *:80>
ServerAdmin [email protected]
Documentroot/home/bbsserver/webapps/root (This can be a tomcat path)
ServerName bbs1.mysteel.com (with domain name here)
Serveralias 61.129.113.60 (alias Here, can be IP or other domain name)
Errorlog Logs/bbs1.mysteel.com-error_log (Error log, not the default is Logs/error.log file, you can configure different logs for different domain names)

Rewriteengine on
Include "/home/bbsserver/webapps/root/rewrite.conf" (the file to be turned, can include a file, can also be written directly on it)

<directory "/home/bbsserver/webapps/root" > (this can be a tomcat path)
DirectoryIndex index.html index.jsp
Options FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>

Proxyrequests OFF

proxypass/http://127.0.0.1:8080/(reverse proxy to that port down)
proxypassreverse/http://127.0.0.1:8080/

</VirtualHost>
2.7.4. If you open the include conf/extra/httpd-mpm.conf, you need to modify the httpd-mpm.conf file in the extra directory to adjust the connection parameters.
OK, so that Apache should basically have been done, remember to open the firewall.


3. Install MySQL
3.1. Install the MySQL server program:
Yum Install mysql-server.x86_64
3.2. Run the init script:
/usr/bin/mysql_install_db
3.3. Cd/var/lib/mysql, you can see:
-RW-RW----1 mysql mysql 10M 09-25 09:38 ibdata1
-RW-RW----1 mysql mysql 5.0M 09-25 09:44 ib_logfile0
-RW-RW----1 mysql mysql 5.0M 09-25 09:38 ib_logfile1
drwx------2 mysql mysql 4.0K 09-25 09:46 MySQL
srwxrwxrwx 1 mysql mysql 0 09-25 09:55 mysql.sock
drwx------2 mysql mysql 4.0K 09-25 09:46 test
3.4. Modify the/etc/my.cnf file to make the appropriate optimizations:
[Mysqld]
#datadir =/var/lib/mysql
Datadir=/export/mysql (The storage address of the database file, change to the address we want)
Socket=/var/lib/mysql/mysql.sock
User=mysql
Thread_concurrency=8
max_connections=10240
Default-character-set=gbk
max_allowed_packet=24m
wait_timeout=31536000
interactive_timeout=31536000
# Default to using old password format for compatibility with MySQL 3.x
# clients (those using the Mysqlclient10 compatibility package).
Old_passwords=1

[Mysqld_safe]
max_allowed_packet=24m
Log-error=/var/log/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid

[Client]
Default-character-set=gbk
Modify it to look like this, the basic is OK.
3.5. Copy the MySQL folder under the/var/lib directory to/export: and change the owning user
Cp-r/var/lib/mysql/export
Cd/export
Chown-r Mysql:mysql MySQL

Service mysqld Start

3.6. Start MySQL:
/bin/sh/usr/bin/mysqld_safe--user=mysql&
Mysql-u root-p
Default root is no password, direct enter into MySQL
3.7. Create a database named Esite:
Create Database Esite;
3.8. Created the MySQL User: esite password: ASDEFG, and authorized to modify any table in the Esite database:
GRANT all privileges the esite.* to [e-mail protected] '% ' identified by ' ASDEFG ';

OK, so far, MySQL should have been done, if you want to connect from outside, remember to open the firewall port 3306.


4. Installing memcached and Memcachedb and Memcacheq
4.1. Installing memcached
4.1.1 Installing the Libevent component (take libevent-1.4.11-stable.tar.gz as an example)
TAR-XZVF libevent-1.4.11-stable.tar.gz
CD libevent-1.4.11-stable
./configure
Make && make install
4.1.2 Installing memcached (take memcached-1.2.5.tar.gz as an example)
TAR-XZVF memcached-1.2.5.tar.gz
CD memcached-1.2.5
./configure
Make && make install

4.1.3 start memcached (indicate port number and cache size), note open the port corresponding to the firewall
Memcached-d-M 512-u root-l 192.168.17.10-p 12001

4.2 Installing Memcachedb
4.2.1 Installing the Libevent component (IBID.)
4.2.2 Installing the Berkeley-db component (take berkeley-db-4.7.25.tar.gz as an example)
TAR-XZVF berkeley-db-4.7.25.tar.gz

CD Db-4.7.25/build_unix
.. /dist/configure
Make && make install

Vi/etc/ld.so.conf
On the last side add:
/usr/local/lib
/usr/local/berkeleydb.4.7/lib

Ldconfig re-load a bit
4.2.3 Installing Memcachedb (take memcachedb-1.2.0.tar.gz as an example):
TAR-XZVF memcachedb-1.2.0.tar.gz

CD memcachedb-1.2.0
./configure
Make && make install
4.2.4 start Memcachedb (refers to the time port number and the path where the cache file is stored), note open the port corresponding to the firewall
Memcachedb-p 12000-d-r-u root-c 10240-h/export/cache/cacdata

4.3 Installing Memcacheq
4.3.1 Installing the Libevent component (IBID.)
4.3.2 Installing the Berkeley-db component (IBID.)
4.3.3 Installing Memcacheq (take memcacheq-0.1.1.tar.gz as an example)
TAR-XZVF memcacheq-0.1.1.tar.gz

CD memcacheq-0.1.1
./configure
Make && make install
4.3.4 Boot Memcacheq (indicates the path where the cache is stored, the port defaults to 22201), notice that the port corresponding to the firewall is opened
Memcacheq-u root-d-r-h/export/mq/mqdata-n-v-l 1024-b 1024


5. Install Jmagick (now we use this image to process more components)
5.1 Installing dependent Packages
Yum Install libpng
Yum Install Libpng-devel
Yum Install Libjpeg
Yum Install Libjpeg-devel
Yum Install GD
Yum Install Gd-devel
Yum Install Libtiff
Yum Install Libtiff-devel

5.2 Installing ImageMagick-6.4.0
./configure--prefix=/usr/local/imagemagick.6.4--enable-shared--without-perl
Make
Make install

5.3 Installing JMagick-6.4.0
./configure--with-java-home= $JAVA _home--with-magick-home=/usr/local/imagemagick.6.4
Make
Make install
5.4 Configuring JMagick-6.4.0
cp/usr/local/lib/libjmagick-6.4.0.so $JAVA _home/jre/lib/amd64/libjmagick.so

6. Tomcat has nothing to say about direct decompression:
TAR-XZVF apache-tomcat-6.0.20.tar.gz

Server Installation configuration document JDK, Apache, MySQL, memcached, Jmagick, Tomcat

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.