We will need the httpd source and the apr, Apache Runtime sources. The apr tools need to be included into the httpd compilation so we move the folders into the httpd directory:. After extracting the contents of the tar. This we did when we installed gcc earlier. A lot of the preliminary tasks for compiling Apache are now carried out using the pre-built configure script supplied as part of the distribution. To build a default installation, good for testing but not recommended to a production server, you simply run.
To do this, use this command:. By default, Apache is configured to start automatically when the server boots. If this is not what you want, disable this behavior by typing:. The default configuration for Apache will allow your server to host a single website.
If you plan on hosting multiple domains on your server, you will need to configure virtual hosts on your Apache web server. When using the Apache web server, you can use virtual hosts similar to server blocks in Nginx to encapsulate configuration details and host more than one domain from a single server.
While this works well for a single site, it can become unwieldy if you are hosting multiple sites. Next, create a sample index. With your site directory and sample index file in place, you are almost ready to create the virtual host files. Virtual host files specify the configuration of your separate sites and tell the Apache web server how to respond to various domain requests.
Before you create your virtual hosts, you will need to create a sites-available directory to store them in. You will also create the sites-enabled directory that tells Apache that a virtual host is ready to serve to visitors. The sites-enabled directory will hold symbolic links to virtual hosts that we want to publish. Create both directories with the following command:.
Next, you will tell Apache to look for virtual hosts in the sites-enabled directory. Save and close the file when you are done adding that line. Now that you have your virtual host directories in place, you will create your virtual host file. This will tell Apache where to find the root directly that holds the publicly accessible web documents. It also tells Apache where to store error and request logs for this particular site.
Now that you have created the virtual host files, you will enable them so that Apache knows to serve them to visitors. To do this, create a symbolic link for each virtual host in the sites-enabled directory:. Active Oldest Votes. You have the correct procedure but it's incomplete. Below the complete procedure : 1. Enable SSL in httpd. Generate server. Improve this answer. Antoine Subit Antoine Subit 9, 4 4 gold badges 34 34 silver badges 50 50 bronze badges.
AntoineSubit Great post. I followed it for RedHat and it works well. Just a minor correction in Step 3. Capricorn Thanks. I edit my answer with your correction — Antoine Subit. Capricorn Capricorn 1 1 gold badge 9 9 silver badges 19 19 bronze badges. Have you got the solution for your problem — erTugRul. The Overflow Blog. You need this while starting your Apache later. Finally, generate a self signed ssl certificate server. If you are getting the below error message, make sure to uncomment the line shown below in httpd.
Finally, this will prompt you to enter the password for your private key before starting up the apache. By default Apache SSL runs on port. I found mistake in your post.
Edit mv apr Other than that, great set of instructions! Jason…great work. This saved me a ton of time and helped explain some things. Thank you!
0コメント