Create a Web server in openSUSE12.1

Source: Internet
Author: User
Create a Web server-Linux Enterprise Application-Linux server application under openSUSE12.1. For more information, see below. Source: Zhongguancun online

OpenSUSE 12.1 Web Server Construction

With the continuous development of Internet technology, Web servers are widely used in small and medium-sized enterprises. Building Web servers is a basic skill that managers often encounter. Web Server construction can be divided into two types: Windows or Linux. Windows can be built by using its own IIS Server, or by using third-party software, such as the Home Web Server software; for Linux, Apache is a commonly used software.



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // img1.gtimg.com/digi/pics/hv1/135/232/996/64824195.jpg'); ">

Linux is a popular Web server construction system in recent years. It has quickly become the mainstream of Web servers with open source, stable, and high security features. In China, Red Hat can be said to be the most popular Linux System for server construction. However, openSUSE is widely used internationally based on its powerful performance, in fact, the principle of setting up a server in Linux is basically the same, but some specific command operations are different. This article shows how to build an Apache2 Web server on the server version of openSUSE12.1.

LAMP is short for Lniux, Apache, MySQL, and PHP. Here we will show you how to build Apache2 Web servers with PHP5 and MySQL in OpenSUSE 12.1 server version. For details, refer to the following steps.

1. Start description

The IP address used in this tutorial is 192.168.0.100, and the host name is Server1.example.com. These settings may be different. You need to modify them according to different situations.

Install MySQL5 in openSUSE 12.1

2. Install MySQL5

First, run the following command to install MySQL5:

Yast2-I mysql-client mysql-community-server

Then we need to create the MySQL system startup key link to start the MySQL server so that MySQL can be automatically started when the system is started,

Systemctl enable mysql. service
Systemctl start mysql. service

To ensure that MySQL installation is complete, run:

Mysql_secure_installation

The following prompt is displayed;

Server1 :~ # Mysql_secure_installation
NOTE: running all parts of this script is recommended for all MySQL
Servers in production use! Please read each step carefully!
In order to log into MySQL to secure it, well need the current
Password for the root user. If youve just installed MySQL, and
You havent set the root password yet, the password will be blank,
So you shoshould just press enter here.
Enter current password for root (enter for none ):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
Root user without the proper authorisation.
Set root password? [Y/n] Input Y
New password: Set the Database password
Re-enter new password: Re-enter the Database password
Password updated successfully!
Reloading privilege tables ..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
To log into MySQL without having to have a user account created
Them. This is intended only for testing, and to make the installation
Go a bit smoother. You shoshould remove them before moving into
Production environment.
Remove anonymous users? [Y/n] Select Y
... Success!
Normally, root shoshould only be allowed to connect from localhost. This
Ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Select Y
... Success!
By default, MySQL comes with a database named test that anyone can
Access. This is also intended only for testing, and shocould be removed
Before moving into a production environment.
Remove test database and access to it? [Y/n] Select Y
-Dropping test database...
... Success!
-Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
Will take effect immediately.
Reload privilege tables now? [Y/n] Select Y
... Success!
Cleaning up...
All done! If youve completed all of the above steps, your MySQL
Installation shoshould now be secure.
Thanks for using MySQL!
Server1 :~ #

Now your MySQL installation should be successful

Install Apache2 in openSUSE 12.1

Apache2 is used as an openSUSE software package. Therefore, we can use the following command to install it:

Yast2-I apache2

Now configure the system to start Apache at boot

Systemctl enable apache2.service

And start Apache2

Systemctl start apache2.service

Enter the http: // keystore file root directory in your browser )):



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // img1.gtimg.com/digi/pics/hv1/136/232/996/64824196.jpg'); ">

Error Message

The default Apache document root directory is the/srv/www/htdocs/directory on openSUSE, And the configuration file is/etc/apache2/httpd. conf. Configure the directory stored in/etc/apache2/conf. d.

4. Install PHP5

We can install the PHP5 and Apache PHP5 modules as follows:

Yast2-I apache2-mod_php5

After the event, we must restart Apache:

Systemctl restart apache2.service

In openSUSE 12.1, PHP5

5. Test PHP5 and obtain the installation information of PHP5.

By default, the file root directory of the website is in/srv/www/htdocs. Now we will create a small php file (info. php) in this directory and call it in the browser. This file will show a lot of details about our PHP installation, such as the installed PHP version and some useful information.

Vi/srv/www/htdocs/info. php



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // img1.gtimg.com/digi/pics/hv1/137/232/996/64824197.jpg'); ">

PHP settings

If you get the message that you do not have a valid Vim binary package installed. Install "VIM", "vim enhanced", or "gvim". Run the following command:

Yast2-I vim

Install VI and try again.

Now, in the browser (such as file http: // 192.168.0.100/info. php ):



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // img1.gtimg.com/digi/pics/hv1/138/232/996/64824198.jpg'); ">

PHP Homepage

As you can see, PHP5 works through Apache 2.0's processing program on the Server API line. If you continue to scroll down, you will see all modules enabled in PHP5. MySQL is not listed, which means that MySQL is not supported in PHP5.

6. Obtain MySQL support

Let PHP get support in MySQL, we can install php5-mysql packages. It is a good idea to install some other PHP5 modules and applications you may need:

Php5-mysql php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx

Restart Apache2 now:

Systemctl restart apache2.service

Now, reload http: // 192.168.0.100/info. php in your browser and scroll down to the module area again. Now, you should find many new modules, including the MySQL module:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // img1.gtimg.com/digi/pics/hv1/139/232/996/64824199.jpg'); ">

MYSQL display

Install phpMyAdmin in openSUSE 12.1

7. Install phpMyAdmin

PhpMyAdmin is a network interface that can be used to manage your MySQL database.

PhpMyAdmin can be installed as follows:

Yast2-I phpMyAdmin

To make sure that all of the websites we created later through ISPConfig can access phpMyAdmin and login using phpmyadmin (http://www.example.com/phpmyadmin) and phpMyAdmin (such as http://www.example.com/phpMyAdmin), Open/etc/apache2/conf. d/phpMyAdmin. conf File Settings

Vi/etc/apache2/conf. d/phpMyAdmin. conf

And add the following two aliases:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // img1.gtimg.com/digi/pics/hv1/140/232/996/64824200.jpg'); ">

Set alias

Restart Apache:

Systemctl restart apache2.service

Enter http: // 192.168.0.100/phpMyAdmin/: in the address bar to access phpMyAdmin.



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // img1.gtimg.com/digi/pics/hv1/141/232/996/64824201.jpg'); ">

PhpMyAdmin page

The above is the specific process of building a Web server in openSUSE12.1 server version. You can follow the prompts to perform step-by-step operations. Basically, you can set the settings. You can try using a virtual machine, after all, setting up a server in Linux is a common operation.

Software link:

Apache: http://httpd.apache.org
PHP: http://www.php.net
MySQL: http://www.mysql.com
PhpMyAdmin: http://www.phpmyadmin.net

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.