Viewed   17 times

I've got a domain like and a path in it like /path so that redirects to another server entirely (let's say

This works, but I'd like to set it up so when I'm at after the redirect the URL bar at the top of the browser reads and so that any subfolders therein would be accessible via

Any idea how to do this? The server ( is running Apache and CentOS.




For that, you'll want a reverse proxy:

ProxyPass /path/
ProxyPassReverse /path/

When you do this, you'll no longer redirect traffic to Traffic will flow through to The web process will see the traffic coming from, not from the end-user.

You can read more details at Apache's mod_proxy documentation.

Friday, March 3, 2023

If all of the urls you are going to rewrite are going to the same end point, you could simply use:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]

in index.php:


How you use the request uri is up to you, you could for example use a simple strpos check:


$rules = array(
    '/forum/' => 'forum',
    '/foo/' => 'foo',
    '/' => 'username'

foreach($rules as $pattern => $action) {
    if (strpos($url, $pattern) === 0) {
        // use action
        $file = "app/$action.php";
        require $file; 
// error handling - 404 no route found
Wednesday, October 26, 2022

The one running as "apache" is the worker process. The one running as "root" is the master process. This is completely normal.

The master process will spawn workers as necessary (with whatever constraints are specified in the configuration file) to handle incoming traffic. It typically will need to be root in order to bind to low ports 80 and 443. After it binds, it will drop privileges to the apache user.

Workers will be reaped from time to time. The long-running process is the one running as root. If you look at httpd.conf, you'll see a block that looks something like:

StartServers       1
MinSpareServers    1
MaxSpareServers    5
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000

So, the master process will spawn one worker in this example on startup. If there's more traffic, it will spawn more workers. Once workers serve 4000 requests, the worker will die, and the master process may spawn new worker processes, depending on traffic.

Friday, August 19, 2022

By de CentOS has a firewall enabled. You need to open port 80 in your firewall to allow access to the apache server.

sudo iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT

If this works then

sudo service iptables save

to save the working configuration for the next restart.

Sunday, July 31, 2022

You can put pretty much anything that does HTTPs termination for the purpose. Even Apache. Bust mostly people use nginx for SSL termination (or pound, or hitch) because it's more lightweight.

Just because you have less software, i.e. Apache (SSL) -> Varnish -> Apache. It doesn't mean that the request flow would be any faster. It still has to go through 3 layers and travel as HTTP packet. So there's no speed up from using less software.

Using Apache as SSL terminator does not make serving static content faster pointless. You can configure it in a way that Apache SSL layer will serve static files directly whereas proxy forward to Varnish for dynamic content.

But overall, nginx is just better for serving static files.

Wednesday, November 30, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :