YaST/Modules/HTTP Server

From openSUSE

(Difference between revisions)
Revision as of 22:05, 21 April 2009
Noloader (Talk | contribs)
Base config
? Previous diff
Revision as of 18:35, 5 November 2009
Tlt (Talk | contribs)
"Main host" section
Next diff →
Line 33: Line 33:
If you are plan to test your site, you can leave this options by default. Only one option should be changed anyway. It is "Server name" (read about this below). If you are plan to test your site, you can leave this options by default. Only one option should be changed anyway. It is "Server name" (read about this below).
-By default '''root document''' have this [[Path|path]] "/srv/www". Attent, that you '''sohuld not''' put slash ("/") on end of path. By default user haven't permission (in OS) to this path.+By default '''root document''' have this [[Path|path]] "/srv/www". Pay Attention that you '''do not''' put a slash ("/") on end of path. By default user does not have permission (in OS) to this path.
[[Permissions (HTTP Server)|Permissions]] (Directory parameter) to root document open for all by default. For testing purposes it is normal. If you changed path to root document, then you should also change path in this permissions. [[Permissions (HTTP Server)|Permissions]] (Directory parameter) to root document open for all by default. For testing purposes it is normal. If you changed path to root document, then you should also change path in this permissions.
Line 50: Line 50:
'''Administration's E-Mail'' may be anything. '''Administration's E-Mail'' may be anything.
- 
=== "Hosts" section === === "Hosts" section ===

Revision as of 18:35, 5 November 2009

ATTENTION. This page rocky translated from russian language page. All names and definitions may be different to original on OpenSUSE.


This article oriented to OpenSUSE 10.3.

Keywords: "Configuring Apache", "Config web-server", "Editing HTTP Server".

Contents

Base config

To configure HTTP Server go to YaST2 Control Center -> Network Services -> HTTP Server. If this module is absent, then you should install HTTP Server. Read about this in article Installing HTTP Server.

Launched module should have title "Config HTTP Server".

"Ports and addresses" section

HTTP Server will work after choose enable option (so you launch Apache2 Service);

"Listening ports" list used to set, which ports are used by HTTP Server (other will be ignored by HTTP Server). If you setting up HTTP Server only for testing your site, then it is enough to add following : "Adress" = "127.0.0.1", "Port" = "80".

Next you can open port in firewall. In additional options you can choose network interface, for which port will be opened.


"Modules" section

Usually HTTP server works with additional features, e.g. PHP, Perl etc. If you need on of this features, you should enable becoming module. If you don't found needed module, you should try to find this module in [[Software Install (YaST2 Control Center)|software installation] (or in internet), and next add this module in this section.

If you don't know which modules are needed, choose PHP5 and Perl.


"Main host" section

If you are plan to test your site, you can leave this options by default. Only one option should be changed anyway. It is "Server name" (read about this below).

By default root document have this path "/srv/www". Pay Attention that you do not put a slash ("/") on end of path. By default user does not have permission (in OS) to this path.

Permissions (Directory parameter) to root document open for all by default. For testing purposes it is normal. If you changed path to root document, then you should also change path in this permissions.

Information. Alias used to create virtual folders for all hosted (by our HTTP Server) sites.

In our case we have alias for "icons" folder. Attention. Alias and path should have slash on end of path.

ScriptAlias is also alias, but only for scripts (e.g. for Perl scripts).

We should set permissions for all alias paths.

Include using to add all other options for out HTTP Server. You can use mask for this.

You can set Server name to "localhost" (without "") if you set HTTP server for testing your site.

'Administration's E-Mail may be anything.

"Hosts" section

Here you can add your sites for HTTP Server. It is virtual hosts (links between site name and path on your computer).

For testing purposes we should edit only one point of list (or, if list is empty, then add one point).

Root document (of virtual host) is path to your site folder where located your site files. This folder should have permissions to read/write for users (in OS). Ans you should not put slash at end of path.

Server name is name of your site. Set this to "localhost" (without ""). You can set this to other name (e.g., mysite.gov), but then you should link your site name with IP address (usually it is 127.0.0.1).

Administrator's E-mail can be anything.

Also you should set permissions to root document. By default it is "allow for all".

Next you should choose ID of virtual host. It is link between site name and IP address (127.0.0.1). Also you can set HTTP header instead of IP. But for site testing it is not must.

After click "Next" or "OK" you will be backed to "Hosts" section.

You can add more virtual hosts (if you need this).

Applying base settings

Click "Apply" button. YaST should write Server configuration and next start Apache service. If it not cased, then read about known issues.

Config security

ATTENTION. Base config runs HTTP server, but it is not safety. To secure your computer with HTTP Server you should do additional config.

This section (security config) not writed yet. To do:

  • Write steps to set security config for testing sites (only on local computer, without external access) on HTTP Server.
  • Write steps to set security config for normal using HTTP Server (with provide sites to external network).


Known issues


Most common problems in the HTTP Server config

  • You set a non-existent folder. If the folder exists, then may be you have an error somewhere in the path. Remember Linux paths are case-sensitive;
  • You have an unnecessary slash at the end of the path, or the reverse: you don't have a required slash at the end of the path. Usually a slash is needed in a set path for aliases and are not required to set a path for directory permissions. Refer to more details about this at the beginning of this article;
  • User doesn't have access (r/w permissions in the OS) to a folder from the virtual hosts section.
  • A relevant module doesn't exist, or isn't working properly. Try enabling, then disabling, them all, then apply the HTTP Server config. If the problem behavior stops, then enable the modules one by one, applying the config for each one in turn, until you reach the module that doesn't work properly.

If any of these errors or problems are present, then you won't be able to apply the HTTP Server config.

Tips & Trics

When you running DNS server on same machine, integration with DNS may be useful for you

Apache in IPv6 network

Howto configure Apache2 working in IPv6 network is described here

"Fail to control Apache"

It can be with not correct config settings. Read previous sections about most probability mistakes.