MAMP Pro: Setting up a host with a network disk location - apache

So I love it that MAMP Pro makes it super easy to set up hosts and access logs and stuff. But I am now working at a location where all of the local copies of websites are on a shared server, e.g. /Volumes/Server/Websites/MyAwesomeWebsite.
Unfortunately, when I try to select a folder on the server, all the folders are greyed out. And when I type the path in manually and restart Apache, I get the message:
"Some hosts have an invalid disk location. These hosts won't be reachable if you start Apache now."
There's really no point in using MAMP Pro if I can't set hosts up on the shared server... any ideas? Or am I gonna have to stop being lazy and edit the virtual hosts by hand from now on?

I was unable to get it to work, so I rolled back from MAMP Pro to MAMP and started editing the virtual host files by hand. It's actually not bad at all, I put a shortcut in my dock that launches both files in BBEdit, so adding new virtual hosts is still quick and easy.

Related

Access my MAMP websites (plural) locally from my iphone

I have created a few websites locally on my mac using MAMP PRO as my local server environment.
I can access these on my mac as I have the opion of adding a local domain (in MAMP PRO) using "local name resolution"
But... I don't know how to access my sites from my iphone which I need to do to test.
If I put my local IP in (on my iphone) I get the MAMP holding page:
The virtual host was set up successfully.
If you can see this page, your new virtual host was set up
successfully. Now, web contents can be added and this placeholder
page1 should be replaced or deleted.
Server name: localhost Document-Root: /Applications/MAMP/htdocs
So I know that works but how do I access my indevidual sites.
The location and structure of my sites are like this:
/Users/myusername/Sites/vhosts/site1/public_html
/Users/myusername/Sites/vhosts/site2/public_html
/Users/myusername/Sites/vhosts/site3/public_html
/Users/myusername/Sites/vhosts/site4/public_html
Could this be to do with the localhost Document-Root? I noticed it was /Applications/MAMP/htdocs
Should I change that or change the location of my sites to be in /Applications/MAMP/htdocs?
Thanks
C
UPDATE:
Ok, so I changed my Document-Root to /Users/myusername/Sites/vhosts/ which now allows me to load the site localy in my browser with 192.168.1.134/site1/public_html
BUT.. when I load 192.168.1.134/site1/public_html from my iphone (on the same wifi network) I get the page title but the page doesn't load. Just hangs!
I use ngrok to forward my localhost and would recommend it. After installing it (it's free), you essentially run something like "ngrok 80" and ngrok will create a public URL that can be accessed from anywhere (AKA your phone) and displays the same content that http://localhost/ would.
Apologies I can't post full http:// links- I'm limited by my reputation.
In your example, ngrok might create a domain "hs673gs.ngrok.com" that corresponds to "localhost" when accessed from your local machine. Going to "hs673gs.ngrok.com/site1/public_html" from your iPhone will be essentially the same as visiting "192.168.1.134/site1/public_html" on your local machine.
Hope this helps.
MAMP has launched an app where you can see your local websites on your mobile through their app MAMP Viewer: https://itunes.apple.com/de/app/mamp-viewer/id1047237620?l=en&mt=8
You just configure the host that you want to use for MAMP Viewer:
Select the host you want to view on MAMP Viewer > On General tab, make sure to check, "for 'MAMP Viewer' (LAN only)" > click save > restart your servers > open the app and check your sites.

remove virtual host on mac

I'm using MAMP PRO on my Mac (running OSX 10.8 Mountain Lion).
Today I added a new host and managed to name it sitename .org which now making me unable to access it online.
Fist I tried to rename the host - didn't work.
Then I tried to remove the host - didn't work.
Tried to rename the folder (wich also was named sitename.org) - didn't work.
So basically now I cannot access this particular site at all.
I've set the correct disk location and everything, but it just uses "Document-Root: /Applications/MAMP/htdocs". Even now, after I've removed the host, it still says" "erver name: sitename.org".
Also restated the machine...
Does anyone know how I can fix this?
I believe MAMP Pro sets all the apache settings on launch, saving them in its preferences plist or some such, so:
Start MAMP Pro
click to the sites tab
click the + button below
fill in the details for your site (desired local url eg sitename or sitename.dev)
restart MAMP
There is a video for Mamp Pro here: http://www.youtube.com/watch?v=4hMW8sTFftI
if you have any cruft from trying to set this up manually, check in your /etc/hosts file, remove any lines that relate to your 'sitename.org'. This way, your machine will look online for sitename.org rather than thinking that the site should be served locally.
You may need to flush your dns cache? for 10.8 try:
sudo killall -HUP mDNSResponder

Changing host and vhost.conf file (lion) broke localhost

I am using OSX local web server and today I needed to set up a virtual host. After doing so, accessing localhost in a browser hangs. 127.0.0.1 says permission denied. Even after I reverted the changed to the files I made under etc/. What's weird is when I check my web sharing, it says the web server can be accessed via { someone-else's-computer.local/~my comp name }. That someone else is someone who is on the same router as me. When I disconnect my wifi, it says it can be accessed via my computer name. I don't know what's going on.
I figured it out something about what I did while editing it the first time or saving it out using TextMate screwed up the file. I backed up hosts file, duplicated hosts-original, renamed it hosts, and the selected all and pasted the contact back in. So basically the content didn't change, but instead I saved it out of text wrangler this time and magic! It worked. Computers are so annoying sometimes.

Is it possible to have WAMP run httpd.exe as user [myself] instead of local SYSTEM?

I run a django application over apache with mod_wsgi, using WAMP.
A certain URL allows me to stream the content of image files, the paths of which are stored in database.
The files can be located whether on local machine or under network drive (\\my\network\folder).
With the development server (manage.py runserver), I have no trouble at all reading and streaming the files.
With WAMP, and with network drive files, I get a IOError : obviously because the httpd instance does not have read permission on said drive.
In the task manager, I see that httpd.exe is run by SYSTEM. I would like to tell WAMP to run the server as [myself] as I have read and write permissions on the shared folder. (eventually, the production server should be run by a 'www-admin' user having the permissions)
Mapping the network shared folder on a drive letter (Z: for instance) does not solve this at all.
The User/Group directives in httpd.conf do not seem to have any kind of influence on Apache's behaviour.
I've also regedited : I tried to duplicate the HKLM\[...]\wampapache registry key under HK_CURRENT_USER\ and rename the original key, but then the new key does not seem to be found when I cmd this
> httpd.exe -n wampapache -k start
or when I run WAMP.
I've run out of ideas :)
Has anybody ever had the same issue?
Win+R, services.msc
edit wampapache and wampmysqld to log on as some user.
the tray icon is a convenient front end to "net start wampapache" and "net start wampmysqld"
The User/Group directives in httpd.conf do not seem to have any kind of influence on Apache's behaviour.
httpd.exe is started by the root user (this is probably why you see it running under SYSTEM). The user and group lines in httpd.conf determine what user the child processes (that httpd spawns) will run under. These forks are what actually handle page requests, etc. so it is possible that your configuration is already doing what you want it to, it is just unclear from looking at task manager.
You could also try using runas to start WAMP/Apache, though your mileage may vary.
I've just found that executing httpd.exe myself works for me... I just loose all the funky WAMP tray icon, and the "restart apache" menu item, really handy whenever I update my application code...
I'll have to make do with this for the moment...

Basic apache server, mapping 127.0.0.1, to 10.0.0.7:8000

I'm working on this project where the client has a virtual server setup. I installed apache and such and got everything working fine on localhost. But in order for it to show up on the internets, the people that run this virtual server needs me to:
"If you try and reach 10.0.0.7:8000 you do not come to the index page but if you do localhost the index page is shown. You need to configure so that it listens to it´s Local IP 10.0.0.7."
Now I am kinda new to this court (I am just a simple webdev that likes to put everything together localhost and uploads his stuff with regular ftp). I bet the answer is simple, but their hotline is closed because they are accross the atlantic. Can someone tell me how to go round and do this? (I am almost blushing because for my not knowing). The virtual server is running on Windows 2003 OS
I believe you should find it relatively easy to do: Listen Directive
Go to the httpd.conf file in your apache/conf dir and change the port and address in the listen directive as:
Listen 10.0.0.7:8000
Don't forget to restart the service.