1

I'm using Google Compute Engine to host a couple applications under one .dev domain so SSL is required.

I have Apache installed based from this guide and my /var/www/ directory looks like:

- domain.dev/ (currently in use - WordPress site)
  - html/
    - wp-content/
    - index.php
    - ...
  - log/
- database.domain.dev/ (currently unused - I want to access phpMyAdmin by going to this URL)
  - html/
  - log/
- subdomain.domain.dev/ (currently in use - a separate project but still under the same domain)
  - html/
    - css/
    - scripts/
    - index.php
    - ...
  - log/

Right now I can visit these three URLS and they work, except of course database.domain.dev - it just gives me the default page that shows Apache is working. I'm trying to install phpMyAdmin on this subdomain but it's not working.

I already have MySQL installed on this server - it's what WordPress is using. I plan to add another database and another user to it that's why I'm trying to install phpMyAdmin as it's easier to manage from there.

SSL is already working since I can see the page that shows Apache is working when I visit the page. The DNS settings have been taken care of from GCP's Cloud DNS.

On my /etc/httpd/sites-available/database.domain.dev.conf, I have this:

<VirtualHost *:80>
    ServerName www.database.domain.dev
    ServerAlias database.domain.dev
    DocumentRoot /var/www/database.domain.dev/html
    ErrorLog /var/www/database.domain.dev/log/error.log
    CustomLog /var/www/database.domain.dev/log/requests.log combined
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =www.database.domain.dev [OR]
    RewriteCond %{SERVER_NAME} =database.domain.dev
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

On my /etc/httpd/conf.d/phpMyAdmin.conf, I have this:

Alias /manage /usr/share/phpMyAdmin

...

<VirtualHost *:80>
    ServerAdmin support@domain.dev
    DocumentRoot /var/www/database.domain.dev/html
    ServerName database.domain.dev
</VirtualHost>

When I visited https://database.domain.dev/manage I expected to see phpMyAdmin pop up but I got an error that said I'm not permitted to view the page. When I tried https://database.domain.dev/bogus it said, the URL can't be found. So that gives me an idea that the alias is working but I don't know why I don't have access to view the page.

dokgu
  • 139
  • 7

0 Answers0