Using apache on mac - NOT the built in one - macos

I've tried downloading apache for my development on Mac OS X (Leopard) from this site:
http://www.techiecorner.com/174/how-to-install-apache-php-mysql-with-macport-in-mac-os-x/
I haven't downloaded php, so I skipped the php checks and right after it finished downloading, and starting the server, I've opended 'localhost' in my browser, and it loaded a page says 'It Works!', so I guess I'm on the right way to using an apache web server.
Now, my questions are:
1. How do I know where is this 'localhost' folder, so I can put there html files and so on?
2. Is it already set that other user can reach my website (once I'll have one under the localhost folder), or do I need to do extra stuff in order to make it so? If this is the matter, what do I need to do more?
Thanks.

from your mentioned site i see that you installed via macports and apache then goes into /opt/local/apache2/.
i think there is an etc directory there, where the configuration is found, in a filed called httpd.conf, there you can find the documentroot directive, which is your 'localhost'folder.
1) it should be /opt/local/apache2/htdocs
2) i guess the default settings of the apache in macports have it listen to incoming requests on all interfaces of your mac, so yes, other users should be able to your website.
ps:
if you're looking for a quick-and-easy method to have a local webserver with php and mysql, i would recommend you take a look at xampp.

Related

Can't access ruby server deployed with passenger

I developed a Ruby website and in order to deploy it, I followed this tutorial. Everything went well, but I skipped all user switching operations because I really didn't see the point of it, and to be honest maybe this is the problem.
My problem is that the server is running, as we can see
And I can do a successful curl on it using the local machine, but I can't access it online.
To be honest, it's the first time I'm deploying a website ever so I'm sure I'm just missing an obvious thing (a DNS maybe), but I don't really know what.
The problem might also come from the fact that I'm using the passenger and Nginx binaries given by the passenger gem installed. I didn't install passenger and Nginx on my system so it's using the binaries from the gem.
EDIT:
Thanks all for the current answers, I think the problème, as stated by the first comment under this question is that I'm not using the default server port configured by Nginx but another one, so I'm gonna try to add my port in the Nginx config file.
And to clarify a bit, because I don't have a server name, I'm running my tests using :
curl ipaddress:port
EDIT 2:
I just tried looking at the config file and it appears that the passenger is generating an Nginx config file (because it uses its own Nginx standalone binary to run) that looks like that, so the port must not be not the problem.
Maybe I really have no choice but to use port:80 but now I'm not even sure if I can ping the Nginx standalone from outside my VM, I'm a total beginner with Nginx
EDIT 3:
A netstat gives me this
So the nginx server is really running, but how can I access it? Because curl ipaddress:8080 (I changed the port since the first try with 90 and replaced it with 8080) is not working. But on the local machine a curl on 0.0.0.0:8080 is still working.

Local Site Defaulting to https

I have a weird problem. I can't preview one of my websites locally because the URL defaults to https - in all of my browsers.
I'm using MAMP PRO on a Mac. I created an alias of the problem site, but I have the same problem when I try the new URL - it defaults to https and doesn't display anything. All my other local sites display normally at http:.
Does anyone have any idea what would cause this and how I can fix it?
Edit: I should add that if I manually change the URL from https to http, it just defaults back to https.
Find where mamp pro installed, and find where is has stored apache.
Go here and read this guide: https://www.digicert.com/ssl-support/apache-disabling-ssl-v3.htm
In summary, find apache config. Most times apache.conf of apache2.conf and append SSLProtocol all -SSLv2 -SSLv3 to in. Then restart apache :)

Xampp Is Messing Up?

First Apache wouldn't work with me so I had to change the port number which fixed everything so that is good, but then I went online and found this
"Start Apache and MySQL and go to localhost in your browser (on the same machine as your server). If this is your first time browsing the local site, you should now see a webpage with the XAMPP logo and a choice of languages. Click on your preferred language."
When I type in localhost:8080 (Apache port), it comes up this I have no clue how to make it so I'm taken to the XAMPP Logo where the languages are. -.- Help please.
Try this :
Just create a sample html page in htdocs of your apache folder and try to access it in browser.
If you name it is as index.html, you just have to write localhost in the browser or localhost/.html
This will make sure your server is working.
And in cmd prompt run mysql -u -p status to check the status of mysql that will check whether mysql is working or not.

Can gitlab be installed with Cherokee web server?

I've looked all over and can't figure out if you could use Cherokee instead of Apache or Nginx for gitlab. I'd rather not run multiple webservers (and imagine that they could conflict anyway). I'm giving this a shot on Ubuntu Server 12.10.
For the record, I've already installed gitlab with this guide up to the Nginx section (with all default settings other than passwords, email addresses, and hostname). I'd like to install gitlab at git.mydomain.com and I would prefer for the local server files to be located at /var/www/git.mydomain.com, as I keep all of my domains under /var/www/.
Since you already have all of the Ruby config done, you just need to hook cherokee
up for hosting RoR by following this guide http://cherokee-project.com/doc/cookbook_ror.html
My only problem turned out to be an issue with Ruby. Once that was resolved, I set up gitlab to use a port (though sockets should work too). Everything seems to work pretty well, except for an issue with pushing over HTTPS, but that might have something to do with my local Eclipse/eGit install.
So yes, gitlab will work with Cherokee.

Apache installation issue (in windows 7)

I want to install Apache Web server,for this I tried in the following way .
Step 1 :
I downloaded Apache Web server from the following link.
Step 2:
I installed in the following way.
click on Run-->next-->Accepted Terms-->next-->next
click on next-->next-->change..
click OK-->next-->install. here I am facing the problem I got two screens.
after completion of 23 seconds,It shows Finish button in main screen, I click on that.
to my conformation,whether it is working or not. I open following URL
http://localhost/
it's not working.
again for my conformation, I open the following window from my right hand side corner of my system.
How can I fix this.
can you suggest me ?
Your port 80 is already in use by another application, you have two options :
Find & Change the port or Deactivate the application that runs in port 80 (IIS, Skype...)
Changing the Apache port from 80 to another value.
There is "something" already listening on port 80 of your system, which will prevent Apache from starting. It could be Skype, or a web-server like IIS or Tomcat.
If you open the command-line (cmd.exe) and run netstat -ona, and look for the local lines that have port 80 in them (ex: 0.0.0.0:80, 127.0.0.1:80), you can then cross-reference the PID of that "something" with Task Manager's Process list (press Ctrl-Shift-Esc).
Then you can attempt to disable it (if it's a Service) or remove/uninstall it.
A couple of other issues -
You are downlading Apache 2.0, which is completly outdated. You should be at least using Apache 2.2.
Your Apache download will not come with PHP - you'll only be able to do HTML pages. Nor will it be configured for security, performance, multi-site, etc.
Unless you have a reason not to, try a WAMP (Windows, Apache, MySQL, PHP) distribution/package that has everything already set up for you. The popular free ones that come to mind are XAMPP and WampServer; and there are commercial ones like Wamp-Developer. Ans also a few others not mentioned, that you can find recommended here on StackOverflow.
use netstat -bano in an elevated command prompt to see what apps are listening on which ports.
But Usually following applications uses port 80 in windows.
IIS
World Wide Web Publishing service
IIS Admin Service
SQL Server Reporting services
Web Deployment Agent Service
Stop above applications if running and check!!!

Resources