![]() c Create new file and populates it with first user and password. # htpasswd -cm /etc/httpd/userauthfile rhceuser01 We can use following options to configure user based authentication. User based authentication provides a way to allow only certain users or group to access web server. This time linuxclient system would be able to access web server as usual, but on windowsystem you will be denied Try to access same websites again from both client systems. Save the file and restart the httpd service Lets allow access only to linuxclient system. In our LAB setup we have two clients linuxclient, and windowclient. All remaining hosts or IP address would be allowed. If you set Order deny, allow Only those host names or IP addresses associated with deny directive are denied access.All remaining hosts or IP address would be denied. If you set Order allow, deny Only those host names or IP addresses associated with allow directive are allowed access.Order play the most important role, when set allow or deny access.When specify a subnet, there is no ending dot at last octet.When specify domain name to allow or deny from, make sure you include the leading dot.If DNS service is unreliable use IP address.By default server listen on port 80, but can be update as well.įor example to limit server only to listen on IP address 192.168.1.1 with port 80 Set Listen Directiveĭefault value, allow access from all hosts If server have multiple IP address, you can limit the IP address and port on which the server can listen for incoming connection. To make navigation easier, turn on line number ESC Key + : +set nu + Enter Key Settings for virtual hosts, which allow Web requests to be sent to different IP addresses or hostnames and have them handled by the same Apache server process.These directives also provide default values for the settings of all virtual hosts. Directives that define the parameters of the main or default server, which responds to requests that are not handled by a virtual host.Global environment directives that control the whole operation of Apache server process.This file is grouped in three sections and each section is well commented This is the main configuration file for httpd web service and completely usable right out of the box for generic web service. We have set up Apache web server with default configuration.īack up the default nf file on a safe location. On window client open browser and type 192.168.1.1/mysite2/index.htm But you need to configure SELinux contexts, user context is system_u and the type is http_sys_content_t. We will enable it later in this article.ĭefault enabled options are sufficient to provide basic web services, you do not need to make any changes. Httpd_enable_homedirs supports access to files from user home directories, default value is off. Supports read/write/execute access by httpd_t files Used to provide permission for php contentĪllows HTTP services to execute GCI scriptsĮnables communication with controlling terminals for example httpd_enable_ftp_server allow Apache to act as an FTP server, which is out of scope for this article. Most of these options are self explained and relate to interactions with other services. Use following command to check all associated SELinux Booleans with httpd Make a sample html page in both directories Make two directories mysite1 and mysite2 in /var/www/html folder We will use most simple html web page for testing. To get your web server up and running, all you need to do is to transfer the web pages or websites in /var/www/html directory. Until you change the value of DocumentRoot directive in nf file, Apache looks for web pages in default location /var/www/html directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |