You don't have permission to access /api/users/roles/3 on this server.
<Directory "/home/costamar">
.
.
Require all granted
</Directory>
$ apachectl -V
> Server version: Apache/2.4.18 (Ubuntu)
Crear un .htaccess en el directorio y poner:
Deny from all
RewriteEngine On
RewriteCond %{REQUEST_URI} !(folder1|script.php|folder2|folder3|folder4) [NC]
Rewriterule ^(.*)$ http://anothersite.com [L,R=302]
$ date // Esta fecha es del server no de apache
$ apachectl -V
$ /usr/sbin/apache2 -v
$ sudo nano /etc/apache2/sites-available/000-default.conf
<Directory "/home/eder/projects">
Order allow,deny
Allow from all
# New directive needed in Apache 2.4.3:
Require all granted
AllowOverride All
</Directory>
<VirtualHost *:80>
ServerName costamaragencias.dev
DocumentRoot /home/user/projects/costamaragencias.dev/
SetEnv APPLICATION_ENV "development"
</VirtualHost>
$ apt-get install apache2
Habilitando modulos con a2enmod (Apache2 Enable Module), activa los modulos que estan en "/etc/apache2/mods-available" y los
pasa a "/etc/apache2/mods-enabled."
- Modulo rewrite : para urls limpias
$ a2enmod rewrite
Luego establecer a que host va a aplicar el rewrite, en el, debemos establecer: 'AllowOverride All', incluso se puede definir a que directorio queremos que aplique. http://httpd.apache.org/docs/2.4/mod/core.html#allowoverride
$ sudo /etc/init.d/apache2 force-reload
=== htaccess ===
RewriteRule ^booking/(\w+)(\w+)$ booking.php?country=$1&lang=$2 RewriteRule ^booking/flights/(\w+)(\w+)$ flights.php?country=$1&lang=$2
Reescribe esta http://my-site/movil/booking.php?country='+ pais +'&lang=' +lang; a : http://my-site/movil/booking/'+ pais +'_' +lang
=== htaccess limitar el tamano de imagenes que se suben === php_value upload_max_filesize 2048K php_value post_max_size 2048K
=== Apache code errors === Error AH01276 [Fri Apr 22 10:48:14.267572 2016] [autoindex:error] [pid 6735] [client 127.0.0.1:44462] AH01276: Cannot serve directory /home/eder/projects/eder/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
Apache Error: No matching DirectoryIndex (index.html) found [SOLVED]
= Apache Error for One General Reason = This error may occur when attempting to access applications that have an index.php file (or other index file), but not an index.html or other specified ‘directory index’ file. For example, phpMyAdmin includes an index.php file upon installation, but not an index.html file. By default Apache is configured with the following: DirectoryIndex index.html
…meaning that Apache will only look for directory index files that are named index.html. So, when attempting to access phpMyAdmin, Apache throws the following error: [autoindex:error] [pid 20115] [client 10.30.6.80:50800] AH01276: Cannot serve directory /usr/share/phpMyAdmin/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive In this case we want to add index.php to the DirectoryIndex directive. $ vim /etc/httpd/conf/httpd.conf
Change: <<< DirectoryIndex index.html
to: DirectoryIndex index.html index.php
Then exit and save the file with the command :wq . Be sure to restart Apache: $ systemctl restart httpd
source: http://www.liquidweb.com/kb/apache-error-no-matching-directoryindex-index-html-found-solved/