# Grafana and Apache

**URL:** <https://community.grafana.com/t/grafana-and-apache/5508>\
**Category:** Configuration\
**Created:** [February 15, 2018, 2:56pm UTC](https://community.grafana.com/t/grafana-and-apache/5508 "2018-02-15T14:56:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cat](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@cat](https://community.grafana.com/u/cat)\
**Post date:** [February 15, 2018, 2:56pm UTC](https://community.grafana.com/t/grafana-and-apache/5508/1 "2018-02-15T14:56:38Z")

</div>

Hi,

I’m a beginner of Grafana and trying to create an URL redirection from [server.domain.com:3000/login](http://server.domain.com:3000/login) to [server.domain.com/grafana](http://server.domain.com/grafana) in Apache.

I’m unable to open the Grafana login page. The port was changed from 3000 to 80 in grafana.ini.

Here is the Apache config file. Did I do something wrong?

```
<VirtualHost *:80>
    DocumentRoot /usr/share/grafana/
    ServerName server.domain.com
    RewriteEngine on
    RewriteRule ^/?$ /grafana [R=permanent,L]

    <Directory "/usr/share/grafana/">
        Require all granted
        AllowOverride All
        Options FollowSymLinks MultiViews
    </Directory>
</VirtualHost>
```

---

<div class="post-metadata">

**Author:** ![dcech](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/dcech/32/49_2.png) [@dcech](https://community.grafana.com/u/dcech)\
**Post date:** [February 15, 2018, 3:31pm UTC](https://community.grafana.com/t/grafana-and-apache/5508/2 "2018-02-15T15:31:46Z")

</div>

Not sure what you’re trying to do here, it sounds like you want to use Apache listening on port 80 as a reverse proxy.

```
<VirtualHost *:80>
  ServerName server.domain.com
  RewriteEngine on
  RewriteRule ^/?$ /grafana/ [R=permanent,L]
  <Location "/grafana">
    ProxyPass http://grafana.staged-by-discourse.com
  </Location>
  ProxyPassReverse /grafana http://grafana.staged-by-discourse.com
</VirtualHost>

```

Then in your grafana custom.ini:

```
[server]
http_addr = 127.0.0.1
http_port = 3000
root_url = http://server.domain.com/grafana/

```

That will set Grafana up to listen on port 3000 on localhost, and Apache to listen on port 80, requests to [http://server.domain.com/grafana/](http://server.domain.com/grafana/) will get reverse proxied to Grafana, and requests to [http://server.domain.com/](http://server.domain.com/) will get redirected to [http://server.domain.com/grafana/](http://server.domain.com/grafana/)
