It seems there is a service using this port. You could kill it by executing:
sudo kill -9 $(sudo lsof -t -i:80)
Then, try to start Apache again.
It seems there is a service using this port. You could kill it by executing:
sudo kill -9 $(sudo lsof -t -i:80)
Then, try to start Apache again.
Looks like you need to uncomment the following:
#LoadModule userdir_module libexec/apache2/mod_userdir.so
and
#Include /private/etc/apache2/extra/httpd-userdir.conf
Then in httpd-userdir.conf you may need to uncomment:
#Include /private/etc/apache2/users/*.conf
Lastly you would need to create /private/etc/apache2/users/kevin.conf if it doesn’t exist. I think it should look something like this:
Options Indexes MultiViews
AllowOverride None
Require all granted
Make sure to restart the Apache server afterwards with:
sudo apachectl restart
In this tutorial, we will activate and learn how to manage URL rewrites using Apache2’s mod_rewrite
module. This tool allows us to rewrite URLs in a cleaner fashion, translating human-readable paths into code-friendly query strings.
This guide is split into two halves: the first sets up a sample web application and the second explains commonly-used rewrite rules.
In this step, we will use a built-in package installer called apt-get
. It simplifies management drastically and facilitates a clean installation.
First, update the system’s package index. This will ensure that old or outdated packages do not interfere with the installation.
Apache2 is the aforementioned HTTP server and the world’s most commonly used. To install it, run the following:
For information on the differences between Nginx and Apache2, the two most popular open-source web servers, see this article.
Now, we need to activate mod_rewrite
.
This will activate the module or alert you that the module is already in effect. To put these changes into effect, restart Apache.
In this section, we will setup a .htaccess
file for simpler rewrite rule management.
A .htaccess
file allows us to modify our rewrite rules without accessing server configuration files. For this reason, .htaccess
is critical to your web application’s security. The period that precedes the filename ensures that the file is hidden.
We will need to set up and secure a few more settings before we can begin.
First, allow changes in the .htaccess
file. Open the default Apache configuration file using nano
or your favorite text editor.
Inside that file, you will find the <VirtualHost *:80>
block on line 1. Inside of that block, add the following block:
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
Your file should now match the following. Make sure that all blocks are properly indented.
<VirtualHost *:80>
<Directory /var/www/html>
. . .
</Directory>
. . .
</VirtualHost>
To put these changes into effect, restart Apache.
Now, create the .htaccess
file.
Add this first line at the top of the new file to activate the RewriteEngine
.
RewriteEngine on
Save and exit the file.
To ensure that other users may only read your .htaccess
, run the following command to update permissions.
You now have an operational .htaccess
file, to govern your web application’s routing rules.
This can be used to start and stop the Apache Web Server on computers runing OS X 10.8, Mountain Lion. Previously, a user could start and stop Apache using the Sharing Preference Pane. But that feature was removed in OS X 10.8.
This is a partial replacement. It allows you to start and stop the computer web server. On systems previous to 10.8, you could use the built-in preference pane for the directory of web files for the current user.
This preference pane will work with earlier versions. It serves no real purpose. But if you do use it with 10.7, for example, be sure to use the Web Sharing preference pane to turn off Web Sharing first.
The download is a disk image file (.dmg). Double click to mount it. It contains the pane. Double-click the pane. It will open the System Preferences application and give you a choice of installing the pane for personal or system use. You can do either. If you install for system use, you will need to enter the password of an administrator user.
If you need to remove the pane, you find its file in the finder. Use the command in the Go menu, Go to Folder…. You will be prompted to enter the a file path.
If the pane has been installed for personal use, enter:
~/Library/PreferencePanes
If it is installed for system use, enter:
/Library/PreferencePanes
This will open up the directory which contains the pane. Its name is:
Web Server.prefPane
To uninstall just drag that file into any other folder or the trash. Close and open the System Preferences application and it will be gone.
Programming: Bob Ackerman, rdacker at comcast.net and Danny Swarzman, danny at stowlake dot com
Also by the Danny, Peggy, an iOS app to play peg solitaire
Abra via terminal na pasta do Apache2.2\bin e execute:
[code type=bash]httpd.exe -k install
Agora bastas abrir o Service ou Serviço, e procurar por “Apache2.2”.