A
A
Artem Kom2013-05-28 19:07:07
PHP
Artem Kom, 2013-05-28 19:07:07

Setting up virtual hosts on a local server?

Hello dear associates. Question about setting up virtual hosts on a local server.
Given.
I have a local Macbook machine with the MAMP Web Server installed on it. On the same machine with the same web server, 8 local sites have been living and doing great for a long time (mostly all on WordPress). All sites on the local server open on a transition like: localhost: 8888 / site-name / (as far as I understand, the local Apache server uses port 8888).
There was a need to install another site on the local server, but there are certain nuances with it. This site is completely self-written and quite complex. It is installed and works exclusively by installing a virtual host. Those. on the machine on which it is already installed in the browser, the site is available at:business-catalog.net.www
The local machine on which the site is already running and from which it needs to be transferred to my MacBook runs under the WinXP operating system, with the XAMPP web server installed and configured.
What I have already done on my MacBook:
In the httpd.conf file, I uncommented the line: Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
In the httpd-vhosts.conf file, I added a text like this at the end:
20434_original.png
In the etc/ file hosts added a line like: 127.0.0.1 business-catalog.net.www
As a result, nothing helps. With the MAMP web server running or stopped, at business-catalog.net.www I see a heartbreaking inscription: “It Works!”
Question
What am I doing wrongHow do you set up a virtual host? Did I correctly specify port 8888 in httpd-vhosts.conf or should I have left it as it was by default 80? Was it necessary to insert this text there at all or in httpd.conf?
The information that php.info gives out is very confusing:
20089_original.png
Why is Virtual Directory Support set to Disabled, how (and is it necessary?) to change it to Enabled (on a computer with Win Xp where the site successfully works locally, this function is displayed as Enabled in php.info)?
Thank you in advance for your help dear accomplices.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Max Kuznetsov, 2013-05-28
@pluseg

It may not suit you, but I would advise you to install Mamp Pro. There, this task is solved in three steps:
1) add a new host
2) specify the desired name
3) specify the physical path to the project root.
ps: only after Mump Pro was able to fully enjoy the development under the poppy, otherwise before that I tried everything and the dances with a tambourine came out worse than in Linux.

N
Nikita Gusakov, 2013-05-28
@hell0w0rd

Take down the mump. This is ugliness!
habrahabr.ru/qa/38731/#answer_148435
I would also advise not to do the part related to Apache, for some reason it was built-in periodically, I personally gave strange statics.
Then nginx remains and it is done like this:

brew install nginx
brew install php54 --with-fpm

gist.github.com/hell0w0rd/5664767 - and something like this in /usr/local/etc/nginx/nginx.conf
It remains only to add the necessary hosts to /etc/hosts and enjoy

P
Puma Thailand, 2013-05-28
@opium

You are breaking into port 80, but you have registered port 8888 in the config, what do you expect from this, that the port will change itself or what?

W
w0den, 2013-05-28
@w0den

1) Is there a line in apache conf Listen 8888?
2) After you made the changes, did you restart the server?
3) Are you sure that you are opening the URL business-catalog.net.www:8888(that is, with the port specified)?
4) By the way, what's interesting in error.log?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question