0

I set up php and mysql on my macbook, and I get the info page when I go to localhost, so I'm ready to start working on my website, but I want to develop on a specific port. So how can I make my server listen on say localhost:2727? Is there a configuration file I need to edit?

Im using the stock OS X webserver, so I believe its apache.

2
  • What web server are you using? Commented Aug 15, 2012 at 1:37
  • Whatever is stock on mac os x. So I believe Apache? Commented Aug 15, 2012 at 1:38

1 Answer 1

1

I've been adding my vhosts configurations to the httpd-vhosts.conf file located for me at /etc/apache2/extra/httpd-vhosts.conf. Try adding something like the following to that file:

NameVirtualHost *:2727 <VirtualHost *:2727> ServerAdmin [email protected] DocumentRoot "/Users/you/Sites/" ServerName dev.site.com ErrorLog "/Users/you/log/apache2/dev-site-error_log" CustomLog "/Users/you/log/apache2/dev-site-access_log" common </VirtualHost> 
Sign up to request clarification or add additional context in comments.

2 Comments

Thats really helpful, but I'm still not getting anything when I go to my specified port. I've got my path set up currectly, but what do I input for server name, and how do I start that server?
Make sure that you add an entry in your /etc/hosts file that points dev.site.com to your localhost. Then you will be able to go to dev.site.com in your browser. You may need to make sure that Apache is running first. I forget how to do that in your Mac Settings but I think you can also run the command "apachectl start"

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.