mirswamp / deployment

SWAMP-in-a-Box
https://mir-swamp.org
Other
61 stars 17 forks source link

localhost 403 access denied #4

Open hexrom opened 6 years ago

hexrom commented 6 years ago

I have set up a local installation of Swamp on a Centos 7 server. After everything's been set up and updated and I try to access the web app at https://localhost.localdomain I get the error: Access to localhost.localdomain was denied You don't have authorization to view this page. HTTP ERROR 403

I feel like the solution to this is something simple but I can't figure it out, and no help searching for solution else where. Any help please?

ghost commented 6 years ago

Hi, We're happy to troubleshoot with you, but we'll need more information. Would you mind taking this offline and emailing us at sib@continuousassurance.org with answers to the below questions? We'd like to know: Is the machine you are using to access the URL https://localhost.localdomain, the actual server, or is it another machine? If it is another machine, localhost will point to that machine and not the server. Would you be able to send us Apache configuration files to further debug this? Thanks!

hexrom commented 6 years ago

The machine I am using to access the https://localhost.localdomain URL is another machine, the local machine. Then I have the SWAMP Centos7 installation running inside a VM on the same local machine. What config do I need to edit to be able to point my local machine to access the server inside the VM?

ghost commented 6 years ago

You need to make the VM IP resolvable via a hostname. Simplest way is to edit the /etc/hosts file on the client machine and add an entry for the VM's IP and the hostname you want to use (something other than localhost.localdomain).

Then, set the hostname to the same hostname as entered in /etc/hosts inside the VM. Possibly add that to /etc/hosts as well inside the VM.

The SWAMP-in-a-Box configuration would then need to be updated to reflect that. As ‘root’ (or using ‘sudo’), run /opt/swamp/bin/swamp_set_web_host It will prompt for the database ‘root’ user’s password and take care of updating all the required SWAMP configuration files and database entries.

If you're still having trouble, please send us an email (sib@continuousassurance.org) so we can coordinate a phone call. Thanks!