Tutorial Setup and Configure Apache on Admin RDP

Tutorial Setup and Configure Apache on Admin RDP
3.3
(6)

Apache is a popular open-source web server software that is widely used to host websites and applications. In this Tutorial, we are going to teach you how to Setup and Configure Apache on Admin RDP (2012, 2016, 2019) step by step. By following the steps outlined in this guide, you will be able to have a fully functioning Apache web server on your Admin RDP, allowing you to host websites and serve content to users.

Prerequisites

1) The Admin RDP should be running a supported version of the Windows Server operating system, such as Windows Server 2012 or later.

2) Administrative Access to the RDP server.

3) Sufficient hardware resources, including CPU, RAM, and disk space, to handle the expected web traffic.

How to Download Apache on Admin RDP Server

In this section, we want to deal with Setup Apache on Admin RDP. The first step is to log in to your Admin RDP.

Open Remote Desktop by searching your Windows Start menu.

Then enter the desired IP to enter the RDP Admin and click Connect.

Note: If you are asked for a password, you must enter the server login password. If you do these steps successfully, you will become an Admin RDP environment.

1 remote-desktop-connection

After successfully entering the Admin RDP environment, you must open one of the browsers you want. Then, you must download the Apache webserver.

2 how-to-download-apache

You should also have C++ Redistributable Visual Studio because the Apache webserver needs it to run on Windows. You can download this by clicking on vc_redist_x86 for a 32-bit operating system and vc_redist_x64 for a 64-bit operating system and then install it.

Once the Apache download is complete, you should go to the location where you downloaded the file.

Then you have to extract it in the place you want. Note that after unzipping the file, you should see the files of this web server. In the next step, we will teach you how to configure Apache.

Setup and Configure Apache on Admin RDP

Now is the time to configure Apache.

First, you should locate the file “httpd.conf” and open it in a standard text editor. Apache can be installed anywhere on the system, but you must change the SVROOT settings to indicate your compressed location:

Define SRVROOT "C:/Apache24" → Define SRVROOT "D:/Apache"

If the httpd.conf file does not have the SRVROOT variable, update everything manually as in the following examples:

ServerRoot "C:/Apache24" → ServerRoot "D:/Apache"
DocumentRoot "C:/Apache24/htdocs" → DocumentRoot "D:/Apache/htdocs"
<Directory "C:/Apache24/htdocs"> → <Directory "D:/Apache/htdocs">
ScriptAlias /cgi-bin/ "C:/Apache24/cgi-bin/" → ScriptAlias /cgi-bin/ "D:/Apache/cgi-bin/"

1- Now you need to add ExecCGI to the Options directory and locate the following line:

Options Indexes FollowSymLinks

and then you must append “ExecCGI“:

Options Indexes FollowSymLinks ExecCGI

This means in Apache CGI/Perl scripts are allowed outside of the CGI-bin director.

2- You need to find and uncomment the following line by removing the # sign from the beginning of the line:

AddHandler CGI-script .cgi

and then add the following line to it:

AddHandler CGI-script .pl

These two lines show how to handle the .cgi / .pl file to Apache.

3- You should add the following command to the end of the httpd.conf file:

ScriptInterpreterSource Registry

This allows Apache to ignore the first line of .cgi / .pl files and instead determine the location of Perl through the Windows registry.

How to Setup Apache on Admin RDP

Now it’s time to start Apache.

First, go to the Apache extraction location and open the command windows/PowerShell prompt in the bin folder.

3 download-the-Apache-webserver

After opening the command prompt, enter the “httpd.exe” command to start Apache.

Note: If you open the PowerShell prompt, you must enter the command “D:\Apache\bin\httpd.exe” to start Apache.

Now you should allow access as appropriate after seeing a Windows Firewall prompt.

The point to note is that you must have access to Apache through the firewall. Otherwise, other devices will not be able to connect to the web server. So allow access accordingly:

4 windows security alert

At this point, you should check the Apache. Go to http://127.0.0.1 from your web browser, provided the previous command window is open. If Apache is running, you must see the image below.

5 setup and configure apache on admin rdp

Note: To exit Apache, just close the command/PowerShell window.

Now you should install Apache as a Windows service. After that, you make sure it runs all the time.

To do this, open the command prompt again and enter the following command:

httpd.exe -k install

Or if you open PowerShell, you can run the following command:

Start-Process PowerShell -Verb RunAs

Then you should enter:

& "D:\Apache\bin\httpd.exe" -k install

Now you must receive a message that Apache is installed.

Type the following command to start the service:

net start Apache2.4

6 command prompt

Apache has an “Apache Monitor” with which you can control the current state of the Apache server and start, stop, or restart the server.

Double-click ApacheMonitor.exe to run the utility. Also, to run it automatically when Windows starts put a shortcut in the Startup folder.

You can press WinKey+R and type “shell:common startup” to access the Startup folder faster, in Admin RDP:

apache service monitor - setup and configure apache on admin rdp

Conclusion

Setup and configure Apache on Admin RDP server is a foundational step in hosting websites and serving content to users. By following this comprehensive guide, you have learned how to install Apache, configure its settings, start and test the server, host websites, and configure virtual hosts. Apache’s flexibility and robustness make it an ideal choice for web servers, and with the knowledge gained from this tutorial, you are now ready to explore the vast possibilities of hosting websites on your own Admin RDP server. If you wish, you can read the Apache vs Litespeed article.

How useful was this post?

Click on a star to rate it!

Average rating 3.3 / 5. Vote count: 6

No votes so far! Be the first to rate this post.

Comments

8 responses to “Tutorial Setup and Configure Apache on Admin RDP”

  1. Abby Avatar
    Abby

    How do I host multiple websites on my Apache server?

    1. Jannson Miller Avatar
      Jannson Miller

      To host multiple websites on your Apache server, you can follow these steps:

      1. Create a directory for each website First, create a directory for each website you want to host. For example, you can create directories like `/var/www/website1` and `/var/www/website2`.

      2. Configure Virtual Hosts: Apache uses Virtual Hosts to host multiple websites on the same server. Open the Apache configuration file located at `/etc/apache2/apache2.conf` or `/etc/httpd/conf/httpd.conf` (depending on your Linux distribution). Uncomment the following line to enable Virtual Hosts:

      # IncludeOptional sites-enabled/*.conf

      Save the changes and exit the file.

      3. Create Virtual Host Configuration: Inside the `/etc/apache2/sites-available/` directory (or `/etc/httpd/conf.d/` directory), create a configuration file for each website you want to host. For example, you can create files like `website1.conf` and `website2.conf`.

      4. Add Virtual Host Configuration: Open each website’s configuration file you created in the previous step and add the following code (replace the example directories and domain names with your own):

      apache

      ServerName http://www.website1.com
      ServerAlias website1.com
      DocumentRoot /var/www/website1

      AllowOverride All
      Require all granted

      Repeat the process for all websites you want to host, making sure to use different domain names and directories.

      6. Enable Virtual Hosts: Run the following command to enable the Virtual Hosts you created:

      sudo a2ensite website1.conf
      sudo a2ensite website2.conf

      7. Restart Apache: Finally, restart the Apache server to apply the changes:

      sudo service apache2 restart

      Now you should be able to access each website using its respective domain name or IP address.

  2. Brenda Avatar
    Brenda

    What can I do if Apache is not working properly or if I see an error page?

    1. Jannson Miller Avatar
      Jannson Miller

      If Apache is not working properly or if you see an error page on admin RDP, you can try the following steps to debug and resolve the issue:

      1. Check Apache error logs

      2. Verify Apache service status

      3. Restart Apache service

      4. Check firewall settings

      5. Test with different browser or device

      6. Check virtual host configuration

      7. Test with a simple HTML file

      8. Check PHP configuration (if applicable)

      9. Consult online resources or forums

  3. Carolees Trada Avatar
    Carolees Trada

    How do I start and stop the Apache service on my RDP server?

    1. Jannson Miller Avatar
      Jannson Miller

      To start and stop the Apache service on your RDP server, you can follow these steps:

      1. Open the command prompt as an administrator. You can do this by pressing the Windows key, typing “cmd”, right-clicking on “Command Prompt,” and selecting “Run as administrator.”

      2. To start the Apache service, run the following command:

      net start apache2.4

      3. To stop the Apache service, run the following command:

      net stop apache2.4

      Again, adjust the command if you are using a different version of Apache.

  4. Caroll Carson Avatar
    Caroll Carson

    Apache is not working properly…what should I do?

    1. Jannson Miller Avatar
      Jannson Miller

      1. Check the Apache error logs

      2. Verify Apache service status

      3. Check for conflicting services or ports

      4. Test connectivity

      5. Firewall configuration

      6. Restart Apache

      7. Seek professional assistance

Leave a Reply

Your email address will not be published. Required fields are marked *