Https and http not working together on MAMP Pro - apache

I created a host on Mamp pro using their GUI app which is called "site1". If I go to https://site1/, it is working fine. If I go to http://site1, then it loads the root of http://localhost.
Based on GUI,
http//localhost's document root is applications/mamp/htodocs/
http//localhost's document root is applications/mamp/htodocs/site1/
If I disable https, then the http site works correctly. I need the both protocol for the site. How could I fix that? Any help? I am also unable to recognize the correct httpd.conf files which are associated with these hostnames.

On the GUI management window, I just added the following code into the additional virtual host parameters and both http and https started working fine together.
ServerName site1
DocumentRoot "/Applications/MAMP/htdocs/site1"
It would still be good to know where and how MAMP is creating the conf files.

Related

How Apache virtual host is working actually when name based is not setup

I have started one EC2 instance
I am using http as I have not set up anything related to SSL yet.
Url I am using is suppose http://ec2-instance-domain/ which is publicly accessible
I install 2 applications on it
Apaches sites-available conf files are as follows
/etc/apache2/sites-available/zurmo.conf
/etc/apache2/sites-available/suitecrm.conf
Since I dont have any domain for any of them yet
ServerName is in actual (example is literally present) zurmo.example.com and suitecrm.example.com
In these files, document root is /var/www/html/zurmo and /var/www/html/suitecrm respectively
When I started apache, both applications are working
If I go to http://ec2-instance-domain/zurmo -> it starts zurmo application login screen
If I go to http://ec2-instance-domain/suitecrm -> it starts suitecrm application login screen
I am confused as how this is working.
What I read about name-based virtualhost was www.one.com would point virtual host having ServerName www.one.com and so on
But here domain name is of ec2-instance which is nowhere used in apache conf files.
Can someone pls explain how this is working in these case ? I tried reading many material but all explain in above www.one.com scenario, not for my scenario
Thanks in advance

Apache as a proxy for multiple nginx servers

I'm starting from the bitnami jenkins stack. Everything is working perfectly with jenkins.
http://sample:8080/jenkins (works fine)
I'm trying to add additional directories to apache to proxy to nginx:
http://sample:8080/other_tool
I can get to the other_tool homepage, but references to that other tool break down because they are looking for http://sample:8080/relative_url rather than http://sample:8080/other_tool/relative_url
I can pull config settings from the necessary files as needed, but it is on an air-gapped network so wholesale posting would be a challenge
The apache conf looks like:
<Directory /other_tool>
ProxyPass http://localhost:9999
ProxyPassReverse http://localhost:9999
</Directory>
The nginx configuration is a standard "/" with root directory. I'm not as familiar with nginx so I can't recall the exact information off the top of my head. If needed I will provide it.
I could try to switch the jenkins hosting over to nginx, but I'm not sure that simplifies anything.
I can't open more ports on the machine. I can't use a subdomain as that would require additional DNS entries that I do not control.
Ideas or suggestions?

apache not serving index.html unless specified

Im new to setting up apache - the site works fine on localhost but when I access it from the LAN it does now display the index.html file - instead the browser says:
This site can’t be reached
localhost refused to connect.
Ive tried editing the apache2.conf file but nothing seems to work
I think you made another mistake. When you are on a different Computer on you network, the Apache server is not available on http://localhost/ but on the domain name or IP of the Apache Server.
The browser tries to open a connection to your client computer. But its not on localhost.

"Apache is functioning normally" on server wildcard subdomains

I have a website that use wildcard-subdomain to change languages. I work fine in localhost.
When I upload to server, the default pages work fine but when I switch to English like this
nghiemthu.net to en.nghiemthu.net
only appear the message:
Apache is functioning normally
Please help.
You should have somewhere in /etc/httpd/ a file with ServerName nghiemthu.net (probably inside a <VirtualHost *:80>).
You need to declare the other domains to serve with ServerAlias.
Here, it seems (you didn't post your configuration so I'm guessing) the request doesn't match any virtual host and goes to the default one (serving the default html file).
See also ServerName and name-based virtual hosts.
If you haven't already activated your SSL certification, then activate it.
If you have already activated your SSL certification, then remove it.

WAMP localhost and phpmyadmin setup

I have inherited a WAMP setup, but needed my http://localhost to point to a different directory "C:/Users/[user.name]/htdocs" due to many dependencies.
I made the following changes in httpd.conf
DocumentRoot "C:/Users/[user.name]/htdocs"
<Directory "C:/Users/[user.name]/htdocs">
where the original path was "c:/wamp/www/"
Now the WAMP default path for phpMyAdmin http://localhost/phpMyAdmin is not working anymore.
Is it possible to fix that via either C:\wamp\alias\phpmyadmin.conf or httpd-vhosts.conf somehow?
Can I suggest a better solution to your requirement to have a site running that does not live in the WAMPServer default location i.e. \wamp\www or \wamp\www\somefolder
If you revert all your httpd.conf changes to the out of the box state and then create a Virtual Host to run the site you have located in your \user.... folder.
Virtual Hosts are a standard Apache feature that allows you to run may sites from a single instance of Apache, a bit like a shared hosting package setup.
You would then have the benefits of the WAMPServer homepage running on localhost and all the other alias's tools as well.
You can then run your site using a nice url for example sitename.dev and the virtual host definition also allows you to setup any site specific requirements without effecting any other site you may want to run.
There is a HowTo Setup Virtual Hosts here on SO