Compile and install the lamp (apache2.2.26mysql5.5.36php5.2.17) environment in ubuntu12.04

Source: Internet
Author: User
Tags apc zts
During this period of time, I tried to install lamp to migrate the data from the Office of the People's Republic of China to the office of the People's Republic of China. it also took a lot of detours to record some of them, which may be messy, but they are all in it.

During this time, the attempt to install lamp for migration of the 2013 2013 project also took a lot of detours. some of the records may be messy, but some of them are difficult to solve, for record reference.

Use vmware workstation to install ubuntu 12.04 lts with the address 192.168.131.130

Install winxp as the encryption server for oa. the address is 192.168.131.10.

Create/myoa/apache/myoa/mysql/myoa/tmp/myoa/attach/myoa/attachment/myoa/attach/cache/myoa/attach/bak

First install the public dependency package

Install gcc make gcc-c ++/g ++ libxml2 libxml2-dev libjpeg62 libjpeg62-dev libjpeg-dev libpng12-dev libfreetype6-dev slapd ldap-utils libssl-dev libmysql ++-dev libcurl3-openssl-dev libmhash-dev libmcrypt-dev libldap-2.4-2 libsasl2-2 libsasl2-dev libtool patch

1. install the dependency package of mysql5.36:

Sudo apt-get install cmake bzr bison libncurses5-dev libaio1 build-essential-y I install one by one, there is a basic can understand.

2. decompress tar zxvf mysql-5.5.36.tar.gz

3. enter the directory cd mysql-5.5.36

3. add a mysql User

Groupadd mysql

Useradd-r-g mysql

Change ownership sudo chown mysql: mysql/myoa/mysql/

4. sudo cmake-DCMAKE_INSTALL_PREFIX =/myoa/mysql-DMYSQL_UNIX_ADDR =/myoa/mysql. sock-DDEFAULT_CHARSET = gbk-DDEFAULT_COLLATION = gbk_chinese_ci-DWITH_EXTRA_CHARSETS: STRING = all-encoding = 1-DWITH_READLINE = 1-DENABLED_LOCAL_INFILE = 1-DMYSQL_DATADIR =/myoa/mysql/data-DWITH_DEBUG = 0-DMYSQL_TCP_PORT = 3306 compile the file

5. Compile and install sudo make

Sudo make install

6. sudo mkdir/etc/mysql

7, cp support-files/my-medium.cnf/etc/mysql/my. cnf

8. modify my. cnf sudo/etc/mysql/my. cnf

[Mysqld]
Socket =/myoa/mysql. sock
Basedir =/myoa/mysql
Datadir =/myoa/mysql/data
Log-error =/myoa/mysql/mysql_error.log
Pid-file =/myoa/mysql. pid

9. sudo cp mysql. server/etc/init. d/mysql
You need to give/etc/init. d/mysql an executable permission.
Sudo chmod + x/etc/init. d/mysql
Modify this file.
Sudo nano/etc/init. d/mysql

Basedir =/myoa/mysql/datadir =/myoa/mysql/data/10, sudo scripts/mysql_install_db -- user = mysql -- basedir =/myoa/mysql -- datadir =/myoa/mysql /data11, sudo/etc/init. d/mysql start may cause an error due to the permission to start the service. the server quit without updating pid file now runs sudo chmod 777-R/myoa/mysql/
Modify the password of the database root user sudo/usr/local/mysql/bin/mysqladmin-u root password 'root' 12,

Sudo ln-s/myoa/mysql/bin/mysqld_safe/usr/bin/

Sudo ln-s/myoa/mysql/bin/mysqladmin/usr/bin/

Sudo ln-s/myoa/mysql/bin/mysql/usr/bin/

13. you can change my. ini under win to the storage path and add lower_case_table_names = 1 to/etc/mysql/my. cnf.

13.1 set remote connection (set as needed)

Sudo mysql-uroot-p enter the set password

Go to execution

Grant all privileges on *. * to root @ "%" identified by "password" with grant option;

Flush privileges;

13.2 to restore the td_oa database using a remote tool, you must modify lower_case_names, restart mysql sudo service mysql restart, and then import the database.

13.3 after import, modify the para_value of host contained in para_name in the table td_oa.sys_para to 192.168.131.10.

14. install sudo tar zxvf httpd2.2.26.tar.gz on apache2.2.26

Sudo./configure -- prefix =/myoa/apache -- enable-so -- enable-MoD-shared = most -- with-mpm = worker

Sudo make

Sudo make install

Sudo ln-s/myoa/apache/bin/apachectl/usr/bin/

Sudo apachectl start can start the service

When combined with php,/etc/apache2/apache2.conf is used.

15. php installation

First, obtain the root permission.

Sudo passwd

Enter the new root password

Then log on as the root user.

Enter the php storage path

Tar zxvf php-5.5.17.tar.gz

Gzip-cd php-5.2.17-fpm-0.5.14.diff.gz | patch-d php-5.2.17-p1 with fpm patch

After patch-p1 <disable_SSLv2.patch is patch SSLv2, a prompt is displayed, indicating that the correct xp_ssl path is entered.

16. install libiconv

Tar zxvf libiconv-1.13.tar.gz
Cd libiconv-1.13/
./Configure -- prefix =/usr/local
Make
Make install

17. settings

Sudo. /configure -- prefix =/myoa/php -- with-config-file-path =/myoa/php/etc -- with-mysql =/myoa/mysql -- with-mysql-sock = /myoa/mysql. sock -- with-mysqli =/myoa/mysql/bin/mysql_config -- with-iconv-dir =/usr/local -- with-freetype-dir -- with-jpeg-dir --- png-dir -- with-zlib -- with-libxml-dir =/usr -- enable-xml -- disable-rpath -- enable-discard-path -- enable-safe-mode -- enable-bcmath -- enable-shmop -- enable-sysvsem -- enable-inline-optimization -- with-curl -- with-curlwrappers -- enable-mbregex -- enable-fastcgi -- enable-fpm -- enable-force-cgi -redirect -- enable-mbstring -- with-mcrypt -- with-gd -- enable-gd-native-ttf -- with-openssl -- with-mhash -- enable-pcntl -- enable-sockets -- -ldap -- with-xmlrpc -- enable-zip -- enable-soap -- enable-ftp -- with-pear -- enable-exif -- with-pdo-mysql -- with-mssql -- with-apxs2 =/ myoa/apache/bin/apxs

18. sudo make ZEND_EXTRA_LIBS = '-liconv' compilation

19. install sudo make install

20. copy php. ini to/myoa/php/etc /.

Set Php. ini and find the setting location of libph5.so.

LoadModule modules/libphp5.so.
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps

21. set documentroot to/myoa/webroot.

23. restart apache sudo apachectl restart

23. sduo nano/myoa/webroot/info. php

Phpinfo ();

?>

To check whether php is successfully installed.

24. install memcache apc scws

Sudo apt-get install autoconf
Sudo ln-s/myoa/php/bin/phpize/usr/bin/
Tar zxvf memcache-2.2.5.tgz
Cd memcache-2.2.5/
Phpize
./Configure -- with-php-config =/myoa/php/bin/php-config
Make
Make install
Cd ../

Tar zxvf APC-3.1.13.tgz
Cd APC-3.1.13/
Phpize
./Configure -- with-php-config =/myoa/php/bin/php-config
Make
Make install
Cd ../

Tar xvjf scws-1.2.2.tar.bz2
Cd scws-1.2.2
./Configure? Prefix =/usr/local/scws
Make & make install

Cd phpext

/Usr/local/php/bin/phpize
./Configure? With-scws =/usr/local/scws? With-php-config =/myoa/php/bin/php-config
Make & make install
Cp dict. xdb/usr/local/scws/etc
Cp rules. ini/usr/local/scws/etc
Chmod-r 755/usr/local/scws/etc

Sudo tar zxvf ZendOptimizer-3.3.3-linux-glibc23-i386
Sudo./install-tty
Enter the path as prompted.

Vi/usr/local/php/etc/php. ini

Add the following sentence:

[Scws]
;
Check whether the set value of extension_dir in php. ini is correct. otherwise, set extension_dir to null,
; Then, specify extension = scws. so as the absolute path.
;
Extension = scws. so
Scws. default. charset = gbk
Scws. default. fpath =/usr/local/scws/etc



Tar jxvf eaccelerator-0.9.5.3.tar.bz2
Cd eaccelerator-0.9.5.3/
/Usr/local/webserver/php/bin/phpize
./Configure -- enable-eaccelerator = shared -- with-php-config =/usr/local/webserver/php/bin/php-config
Make
Make install
Cd ../

Sudo cp/myoa/php/lib/php/extensions/no-debug-zts-20060613/*/myoa/php/ext/
Or
Sudo ln-s/myoa/php/lib/php/extensions/no-debug-zts-20060613/*/myoa/php/ext/
Create a soft connection
Change php. ini
Sudo nano/myoa/php/etc. php. ini
Change 1. include_path = ".: myoa/webroot"
2. extension_dir = "/myoa/php/ext"
3. upload_max_filesize = 2048 M
4,
[Scws]
Extension = scws. so
Scws. default. charset = gbk
Scws. default. fpath =/usr/local/scws/etc
[Memcache]
Extension = memcache. so
Memcache. allow_failover = On
Memcache. max_failover_attempts = 10
Memcache. chunk_size = 8192
Memcache. default_port = 11211
; Memcache. hash_strategy = "standard"
; Memcache. hash_function = "crc32"

[Apc]
Extension = apc. so
Apc. enabled = on
Apc. shm_segments = 1
Apc. shm_size = 32 M
Apc. user_entries_hint = 0
Apc. user_ttl = 0
Apc. cache_by_default = off
Apc. enable_cli = off
Apc. ttl = 0
Apc. gc_ttl = 3600
Apc. max_file_size = 1 m
; Apc. mmap_file_mask =
Apc. num_files_hint = 0
Apc. optimization = 0
Apc. report_autofilter = off
Apc. stat = off
Apc. write_lock = off
Apc. rfc1867 = off
Apc. canonicalize = 0
Apc. use_request_time = 0
Apc. filters = ""
Apc. slam_defense = off

25. wget webroot compressed package

Go to extract

Modify the SQL connection parameters in the inc/oa_config.php file.

Zookeeper
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.