Build your own lamp and wordpress on ubuntu7.04

Source: Internet
Author: User
Tags install wordpress
Build your own lamp and wordpress-Linux Enterprise Application-Linux server application information on ubuntu7.04. The following is a detailed description. LAMP (Linux + Apache + MySQL + PHP/Perl/Python) has become a de facto standard for the Web community in recent years and has become a cheap and open source code, A high-performance Web development platform. Here, I will introduce how to install the LAMP combination in ubuntu7.04 and how to build a website using wordpress, the world's most popular blog system. All related software are open-source products, so you don't have to worry about the product price and copyright issues. These software is now very user-friendly and easy to use. This document assumes that you have experience with ubuntu or other linux systems. OK:

Install
IP address and domain name Configuration
First, assume that you use a fixed IP address (in fact, each server should have a fixed IP address) and assume that you have a domain name. Of course, if there is no domain name, you can directly use IP addresses in subsequent management steps. Well, let's edit the/etc/network/interfaces file and configure a fixed IP address. Then edit the/etc/hosts file to match your domain name with the IP Address:

Vi/etc/hosts

127.0.0.1 localhost. localdomain localhost
192.168.0.100 www.forwind.com server1

# The following lines are desirable for IPv6 capable hosts
: 1 ip6-localhost ip6-loopback
Fe00: 0 ip6-localnet
Ip6-mcastprefix ff00: 0
Ff02: 1 ip6-allnodes
Ff02: 2 ip6-allrouters
Ff02: 3 ip6-allhosts

Finally, edit the/etc/hostname file, add www.forwind.cn, and restart.

Okay. Let's confirm and enter it in the terminal.

Hostname
Hostname-f

All results should be www.forwind.cn

Install related packages
We can use the following command to install all the required packages at a time:

Apt-get install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev linux-kernel-headers lynx m4 make ncftp nmap openssl perl -modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g ++

Install LAMP Software
Open new, edit?> Mark a software package using a task group?> Select LAMP Server. Then install phpmyadmin separately:

Sudo apt-get install phpmyadmin

Confirm Installation
On your machine, open Firefox or other browsers and enter the IP address or domain name you Just configured to see if the Apache homepage is displayed?

Set LAMP
Basic settings
Set the apache password: grant all privileges on *. * TO root @ localhost identified by "xxx"; here, root is the user name and xxx is the password you want TO set. After the password is set, use "quit" to exit. Next let's take a look at the current Mysql database:

Mysqlshow-u root-p // mysqlshow

The result is the information_schema and mysql databases.

Configure apache2.conf
Sudo gedit/etc/apache2/apache2.conf

Remove the comment "#" before AddHandler cgi-script. cgi.

Then add such a segment in any place:

DocumentRoot/var/www/

Options FollowSymLinks
AllowOverride all

Options ExecCGI


Restart the server
Sudo/etc/init. d/apache2 restart

Other settings
If you want MySQL to accept not only the localhost connection, but all, you need to edit/etc/mysql/my. cnf and comment the following line into the following:

Vi/etc/mysql/my. cnf

[…]
# Bind-address = 127.0.0.1
[…]

Then restart

/Etc/init. d/mysql restart

Next, check the network connection.

Netstat-tap

In the result, you should see the following content:

Tcp 0 0 *: mysql *: * LISTEN 22565/mysqld

Of course, you can also enable the mod_rewrite module on the local machine

Sudo a2enmod rewrite

In this way, you can generate various specified forms of Permalink (a static html form of page address) for search engine search and user use. For more information about mod_rewrite, google.

In this way, a basic LAMP is created, and the www Network Service root directory appears under the/var directory. If you want to create your own site, put the PHP program under/var/www/and the CGI program under/var/www/cgi. Next, we will explain the basic steps for building a website using wordpress, the world's most popular blog system.

Install wordpress
Create a database
If the service provider of your VM provides you with a database, you do not have to do it yourself. However, generally, service providers provide interfaces that allow you to create databases, create users and passwords, or use your own computers as website servers. We recommend that you follow these steps, create a database. Here, we will only explain how to use local databases. The database service steps of service providers are almost the same.

* Www.forwind.cn/phpmyadminenter phpmyadmin. You can change the domain name to the IP address you just set.

* Click Create new database to add the database name, for example, forwind.
* Return to the homepage and click Privileges to go to permission management and create a database user. Click Add a user, select Use text field (Use text field), Add the user name to be added, and enter a password as responsible as possible. Keep the default items in the Global privileges column. Click Go ).
* Return to the permission page, click the Check privileges (Check permission) icon next to the created username, and then select the created database jiang_demo, phpMyadmin will take you to the Add privileges to the following database (Add permissions for the database) page, Check All (select All), and then execute.
* So far, the database creation has been completed.

After creating a database, do not forget to record your database, username, password, and hostname.

Install wordpress
Go to the decompressed Wordpress folder, edit the wp-config-sample.php file in the editor, and find the following lines:

1. define ('db _ name', 'wordpress '); // The NAME of the database
2. define ('db _ user', 'username'); // Your MySQL username
3. define ('db _ password', 'Password ');//... And password
4. define ('db _ host', 'localhost'); // 99% chance you won't need to change this value

Fill in the Database Name, user name, password, and database server (hostname) We have configured. Then enter the Region. In this way, the installation starts. After the installation is complete, you can go to http://www.forwind.cn/wp-admin/for management.

This is the basic step for installing and creating LAMP + wordpress.

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.