Install wordpress3.4 in Linux

Source: Internet
Author: User
Tags install wordpress vps server wordpress login
Document directory
  • Start WordPress Installation

Recently I bought a VPs server for my blog. The VPS system is centos 5.8.

Install MySQL, Apache, and PHP

 

First install MYSQL:

1. Download the MySQL server, client, and devel installation packages (if the devel package is not installed, an error will be reported during PHP compilation, indicating that the MySQL header file cannot be found ):

$ Wget http://mysql.llarian.net/Downloads/MySQL-5.5/MySQL-server-5.5.25-1.linux2.6.i386.rpm

$ Wget http://mysql.llarian.net/Downloads/MySQL-5.5/MySQL-client-5.5.25-1.linux2.6.i386.rpm

$ Wget http://mysql.llarian.net/Downloads/MySQL-5.5/MySQL-devel-5.5.25-1.linux2.6.i386.rpm

 

2. install these three RPM packages (default installation path ):

$ Sudo rpm-IVH MySQL-server-5.5.25-1.linux2.6.i386.rpm MySQL-client-5.5.25-1.linux2.6.i386.rpm MySQL-devel-5.5.25-1.linux2.6.i386.rpm

 

3. Start MySQL service:

$ Sudo/sbin/service MySQL start

 

4. Set the admin user name and password for MySQL:

$ Sudo/usr/bin/mysqladmin-u Root Password 'new-password'

 

Second, install Apache Web Server:

1. Download tarball from the official website

$ Wget http://newverhost.com/pub//httpd/httpd-2.4.2.tar.bz2

$ Bzip2-D httpd-2.4.2.tar.bz2

$ Tar xvf httpd-2.4.2.tar

 

2. Download APR and APR-util

(1) download the tarball of APR and APR-util and decompress it.

$ Wget http://download.nextag.com/apache//apr/apr-1.4.6.tar.gz

$ Gzip-D apr-1.4.6.tar.gz

$ Tar xvf apr-1.4.6.tar

$ Wget http://download.nextag.com/apache//apr/apr-util-1.4.1.tar.gz

$ Gzip-D apr-util-1.4.1.tar.gz

$ Tar xvf apr-util-1.4.1.tar

(2) Move the decompressed APR and APR-util to the httpd-2.4.2/srclib/after Apache decompression, and remove the version number of the APR and APR-util folders.

$ MV apr-1.4.6 httpd-2.4.2/srclib/APR

$ MV apr-util-1.4.1 httpd-2.4.2/srclib/APR-util

 

3. Compile and install PCRE

(1) download and decompress the tarball

$ Wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.bz2

$ Bzip2-D pcre-8.30.tar.bz2

$ Tar xvf pcre-8.30.tar

(2) Installation

$ Sudo./configure-with-PCRE = PCRE installation path

$ Sudo make; sudo make install

 

4. Compile and install Apache

$ Httpd-2.4.2 CD

$ Sudo./configure-Prefix = Apache installation path-with-installed ded-Apr-with-PCRE = previous PCRE installation path

$ Sudo make; sudo make install

 

5. Test whether apache service is successfully installed.

$ Sudo Apache installation path/bin/apachectl-K start

Then visit http: // localhost to check whether the installation is successful.

If you see the words it works, it indicates that Apache has been installed and started successfully.

Disable apache service:

$ Sudo Apache installation path/bin/apachectl-K stop

 

Then install PHP:1. Download tarball $ wget unzip Bzip2-D php-5.4.4.tar.bz2 $ tar xvf php-5.4.4.tar from the official website. 2. install other Dependencies $ sudo Yum install gdbm-devel $ sudo Yum install lib- devel

$ Sudo Yum install libjpeg-devel
$ Sudo Yum install libpng-devel
$ Sudo Yum install FreeType-devel
$ Sudo. /configure-Prefix = PHP installation path-with-apxs2 = Apache installation path/bin/apxs-with-mysql =/usr-with-zlib-Dir =/usr/lib-with-PNG -Dir-with-JPEG-Dir =/usr/local/modules 6-with-Gd =/usr-with-zlib-Dir =/usr/local/modules/zlib- enable-track-vars-Disable-debug-enable-URL-supported des-enable-sockets-enable-force-CGI-redirect-enable-calendar-with-config-file-Path = /etc-with-FreeType-Dir =/usr/local/modules/FreeType-enable-magic-quotes-enable-ftp-enable-Gd-native-TTF-with-TTF- with-gdbm-with-gettext-with-iconv-with-XML-enable-mbstring = All-enable-memory-Limit

Where:

-With-apxs2 points to the installation path of the Apache Web Server

-With-mysql points to the path of MySQL header files (MySQL-devel must be installed)

$ Sudo make; sudo make install

 

(If you need Wordpress to Support Automatically decompressing the downloaded plug-ins and themes, you need to add zlib support during PHP compilation. Otherwise, WordPress reports an error during decompression:

Abort pclzip. Lib. php: Missing zlib extensions

The procedure for installing zlib extension is as follows:

$ Wget http://www.zlib.net/zlib-1.2.3.tar.gz
$ Tar-xvzf zlib-1.2.3.tar.gz
$ Zlib-1.2.3.tar.gz CD
$./Configure-Prefix =/usr/local/modules/zlib
$ Sudo make
$ Sudo make install

 

Install zlib through Yum:

$ Sudo Yum install zlib-devel

Then, you can add this parameter to the configure command during PHP compilation to set the zlib position:

-With-zlib-Dir =/usr/local/modules/zlib)

3. Set the httpd. conf file of Apache

(1) Open the Apache configuration file (/usr/local/apache2/CONF/httpd. conf)

Check whether the following content exists and is not commented out

Loadmodule php5_module modules/libphp5.so

(2) Add the following content at the end of the configuration file:

<Filesmatch \. php $>
Sethandler application/X-httpd-PHP
</Filesmatch>

 

4. Create a PHP. ini file

Copy PHP. ini-recommended directly from the extracted tarball to the PHP installation path:

$ CP php-5.2.1/PHP. ini-recommendedPHP installation path/Lib/PHP. ini

 

5. Restart the apache service.

$ Sudo Apache installation path/bin/apachectl-K restart

 

Start WordPress Installation

1. Download and decompress WordPress

$ Wget http://wordpress.org/latest.tar.gz

$ Gzip-D latest.tar.gz

$ Tar-xvf latest.tar

 

2. Create a database used by the blog

$ mysql -u [adminusername] -p
mysql> CREATE DATABASE [databasename];
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON [databasename].* TO "wordpressusername"@"hostname"
    -> IDENTIFIED BY "password";Query OK, 0 rows affected (0.00 sec)mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.01 sec)mysql> EXITBye

 

3. Set the wp-config.php configuration file

(1) configure the database content:

// ** MySQL settings-you can get this info from your web host **//
/** The name of the database for WordPress */
Define ('db _ name', 'databasename ');

/** MySQL database username */
Define ('db _ user', 'wordpressusername ');

/** MySQL Database Password */
Define ('db _ password', 'Password ');

/** MySQL hostname */
Define ('db _ host', 'localhost ');

/** Database charset to use in creating database tables .*/
Define ('db _ charset', 'utf8 ′);

/** The database collate type. Don't change this if in doubt .*/
Define ('db _ collate ',");

 

(2) Generate security keys

Use https://api.wordpress.org/secret-key/1.1/salt/to generate the keyand fill in the configuration file's corresponding location:

define('AUTH_KEY',         't`DK%X:>xy|e-Z(BXb/f(Ur`8#~UzUQG-^_Cs_GHs5U-&Wb?pgn^p8(2@}IcnCa|');define('SECURE_AUTH_KEY',  'D&ovlU#|CvJ##uNq}bel+^MFtT&.b9{UvR]g%ixsXhGlRJ7q!h}XWdEC[BOKXssj');define('LOGGED_IN_KEY',    'MGKi8Br(&{H*~&0s;{k0<S(O:+f#WM+q|npJ-+P;RDKT:~jrmgj#/-,[hOBk!ry^');define('NONCE_KEY',        'FIsAsXJKL5ZlQo)iD-pt??eUbdc{_Cn<4!d~yqz))&B D?AwK%)+)F2aNwI|siOe');define('AUTH_SALT',        '7T-!^i!0,w)L#JK@pc2{8XE[DenYI^BVf{L:jvF,hf}zBf883td6D;Vcy8,S)-&G');define('SECURE_AUTH_SALT', 'I6`V|mDZq21-J|ihb u^q0F }F_NUcy`l,=obGtq*p#Ybe4a31R,r=|n#=]@]c #');define('LOGGED_IN_SALT',   'w<$4c$Hmd%/*]`Oom>(hdXW|0M=X={we6;Mpvtg+V.o<$|#_}qG(GaVDEsn,~*4i');define('NONCE_SALT',       'a|#h{c5|P &xWs4IZ20c2&%4!c(/uG}W:mAvy<I44`jAbup]t=]V<`}.py(wTP%%');
 
4. Create a directory for the Web server corresponding to the blog
Here I select/www/blog as the WordPress web directory
First, create a directory tree:
$ mkdir -p /www/blog
Then, change the permission of all directories in the directory tree to rwxr-XR-X so that everyone can access the directory:
$ sudo chmod 755 www
$ sudo chmod 755 www/blog
 
5. Modify the Apache configuration file"Apache installation path/CONF/httpd. conf"To point the document root to/www/blog.
Set the default

DocumentRoot "/usr/local/apache2/htdocs"
<Directory "/usr/local/apache2/htdocs">

Change

DocumentRoot "/www/blog"
<Directory "/www/blog">

 

Add index. php to the following configuration section:

<Ifmodule dir_module>
Directoryindex index.html index. php
</Ifmodule>

 

6. Run install. php to install Wordpress.

Access http://example.com/wp-admin/install.php (example.com is the domain name of your own server)

If you do not configure database-related information in the wp-config.php beforehand, the following screen appears to configure the DB:

 

After the installation is complete, configure the WordPress login name and password:

 

So far, the installation is complete.

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.