Ubuntu under Apache+mysql+php+mysql and other webserver construction

Source: Internet
Author: User
Tags install php imap openssl

I believe a lot of people like me, want to build a webserver of their own. There is a lot of information online. However, because of the difference in version numbers, there is always a problem that cannot be fully realized according to a tutorial. Recently I also toss for several days, Google can not use, just can Baidu, really want to say a dirty word. Say less nonsense and get into the text.

1, the software to be downloaded and its address:

①. Apache Location: http://httpd.apache.org/

②.openssl Location: http://www.openssl.org/

③.mysql Location: http://www.mysql.com

④.php Location: http://www.php.net

⑤.ftp://ftp.uu.net/graphics/jpeg

⑥. http://www.libpng.org/pub/png/libpng.html

⑦. http://www.zlib.net/

⑧.ftp:ftp.cac.washington.edu/imap/

It's a good idea to get root permission before installing, I'm using Ubuntu. Because Ubuntu did not give the opportunity to set the Rootpassword when it was installed. However, the first user that was created belongs to the Administrators group. This user can change root password for security reasons. Ubuntu's Rootpassword are randomly generated every time they are powered on. Therefore, each boot will need to reset the Rootpassword.

Chitian such as the following:

sudo passwd root

Reset password then use the command to log in root

Su Root

1. Install MySQL

Apt-get Install Mysql-server

Apt-get Install Mysql-client

2. You need to install various features supported by PHP and various libraries that support PHP

After downloading the above library, because the installation method is almost the same, so casually take one as an example, in this case zlib, because the zlib is more special.

The default installation folder is used when installing zlib, you cannot specify an installation folder, and I do not know why. After you have specified the installation folder, you will not continue to install some of the following features. This is true even if the installation Folder page for zlib is specified.

Installation commands such as the following;

First solution Engross: TAR-ZXVF zlib-1.2.8.tar.gz

CD zlib-1.2.8

./configure

Make&make Install

The remaining libraries are installed in a similar

The installation process assumes that you are experiencing problems entering./configure--help View installation help.

It is also important to note that two times is required to install Apache./configuer (This is said to have been modified after 2.0.) In the online installation of the tutorial is generally only executed once, weak weak say, this seems to violate the GNU installation rules, of course, this sentence is not what I said, in a dialogue with foreigners see. The first execution needs to be used to generate makefile before make. After the makefile is generated, it needs to be executed again./configure. Verify that make clean is added before makes, or the installation may fail.

2.1 Installing Apache, you may need to install APR and apr-util two packages during the installation process, which can be obtained with the apt-get above.

Ssl_base=. /openssl./configure--prefix=/usr/local/apache--enable-so Enable-ssl

3. Install PHP

After decompression

./configuer--prefix/usr/local/php--with-mysqli=/path/to/mysql_config--withapxs2=/user/local/apache/bin/apxs The subsequent input will be able to ... It's too hard to enter. Steal a lazy I copy my come over ...

'./configure '--prefix=/usr/local/php/'--with-mysqli=/usr/bin/mysql_config '--with-apxs2=/usr/local/apache2/ Bin/apxs '

'--with-jpeg-dir=/usr/local/jpeg/'--with-tiff-dir=/usr/local/tiff/'--with-zlib-dir=/usr/local/lib/'

'--with-imap=/usr/local/imap-2007f/'--with-openssl=/usr/local/ssl/'--WITH-GD '

You can get rid of the middle single-lead.

After that, the make& make install is complete.

The next thing you need to do is copy the INI file to the Lib folder.

CP Php.ini-dest/usr/local/lib/php.ini



After installation, it is necessary to test whether the installation has been completed successfully.

1.apache installation Correct test

Some simple configuration is required after the installation is complete. First configure the PHP file, in the folder to find httpd.conf

Then VI httpd.conf find the parts of the AddType (but also can not find, put together just for ease of management)

Enter for example the following two sentences:

Then turn on Apacheserver.


First Test apacheserver normal work or not, in the local browser input localhost display demo sample such as the following output, the installation is correct

Check to see if PHP is normal: Create a new test.php in the folder below and enter the contents of the second image below:

After you enter localhost/test.php in your Web browser, you will see such as the following page. Indicates that the configuration was successful:

Now test whether SSL is installed successfully:

First, you need to do the following configuration (for apache2.x):

1. First enable SSL, with VI open the above configured file httpd.conf to open the line such as the following gaze (the first line)

Then see if two files have enabled SSL

Assuming you see the above output, you need to create two files (the last two files in the bottom):

Enter the OpenSSL source code file. Execute such as the following command:

Please remember to enter something afterwards, then enter such as the following command (enter the command you just entered and follow the prompts to configure it):

Then copy the file:

Then do some configuration for httpd.conf (open the last line below): VI httpd.conf

After you have done this, start webserver, and enter for example the following command:

After that, the configuration is complete.

Finally, we look at the results of the test, two different computer test results:

Under Windows on the same LAN:

Do not write very good, I hope you correct me.


Ubuntu under Apache+mysql+php+mysql and other webserver construction

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.