[RISOLTO]mod_rewrite in Apache - Ubuntu Linux 14.04

Installazione, configurazione e uso di Ubuntu come server: web, ftp, mail, news, proxy, dns e altro.
Scrivi risposta
Razvancs
Prode Principiante
Messaggi: 7
Iscrizione: mercoledì 15 aprile 2015, 10:56
Distribuzione: 14.04
Sesso: Maschile

[RISOLTO]mod_rewrite in Apache - Ubuntu Linux 14.04

Messaggio da Razvancs »

Salve, da 2 giorni sono sul mio vps e non posso fare mod_rewrite che funziona
Intallato Server Lamp per hosting dei domini - ok
installato ftp - ok
installato webmin - ok
su root :
sudo a2enmod rewrite
sudo service apache2 restart
Module rewrite already enabled. (no shit?)
quando apro il mio sito per esempio website.com/news non funziona, pagina non trovata (wordpress) . Anche abilitato permalinks dal panello.. :muro:
Vado su : apache conf
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

Messo anche:
<Directory /var/www/>
AllowOverride All
Require all granted
</Directory>

Niente...che devo fare???

ho fatto anche come dice:
http://www.dev-metal.com/enable-mod_rew ... 14-04-lts/

Ma niente!!!! Help??? :muro: :muro: :muro:
Ultima modifica di Razvancs il mercoledì 15 aprile 2015, 17:28, modificato 1 volta in totale.
Avatar utente
SuperStep
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 2037
Iscrizione: lunedì 19 dicembre 2011, 16:26
Desktop: Unity
Distribuzione: Ubuntu 16.04 LTS x86_64
Sesso: Maschile
Località: Somma Vesuviana (NA)

Re: mod_rewrite in Apache non funziona - Ubuntu Linux 14.04.

Messaggio da SuperStep »

per il rewrite, si utilizzano alcuni parametri nella configurazione del virtualhost.

Alcuni:

RewriteEngine: (on|off) #inutile specificare
RewriteRule #la regola di rewrite
RewriteCond #la condizione per il rewrite (se deve oppure non deve farlo).

http://httpd.apache.org/docs/current/mo ... write.html

[edit]
sei pregato di mettere file di configurazione|sorgenti|script|... nel tag [ code] [/code]
ubuntu 16.04 LTS 64-bit - Memoria: 31,3 Gib - Processore: Intel Core i7-5960X CPU @ 3.00 GHz × 16 - Grafica: AMD Radeon HD 7800 Series - Disco: SSD 256 GB x 4 (RAID 01)
Razvancs
Prode Principiante
Messaggi: 7
Iscrizione: mercoledì 15 aprile 2015, 10:56
Distribuzione: 14.04
Sesso: Maschile

Re: mod_rewrite in Apache non funziona - Ubuntu Linux 14.04.

Messaggio da Razvancs »

in .htaccess dentro /var/www/html/www.sitoweb.com ho' il codice:

Codice: Seleziona tutto

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
devo mettere il codice in un altra parte? Dimmi dove devo andare e che devo mettere . :D
Avatar utente
SuperStep
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 2037
Iscrizione: lunedì 19 dicembre 2011, 16:26
Desktop: Unity
Distribuzione: Ubuntu 16.04 LTS x86_64
Sesso: Maschile
Località: Somma Vesuviana (NA)

Re: mod_rewrite in Apache non funziona - Ubuntu Linux 14.04.

Messaggio da SuperStep »

ma il server web ti parte correttamente? puoi postare le ultime 20 righe presenti in /var/log/apache2/error.log
ubuntu 16.04 LTS 64-bit - Memoria: 31,3 Gib - Processore: Intel Core i7-5960X CPU @ 3.00 GHz × 16 - Grafica: AMD Radeon HD 7800 Series - Disco: SSD 256 GB x 4 (RAID 01)
Razvancs
Prode Principiante
Messaggi: 7
Iscrizione: mercoledì 15 aprile 2015, 10:56
Distribuzione: 14.04
Sesso: Maschile

Re: mod_rewrite in Apache non funziona - Ubuntu Linux 14.04.

Messaggio da Razvancs »

Codice: Seleziona tutto

[Wed Apr 15 09:05:56.389895 2015] [mpm_prefork:notice] [pid 18029] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.7 configured -- resuming normal operations
[Wed Apr 15 09:05:56.389912 2015] [core:notice] [pid 18029] AH00094: Command line: '/usr/sbin/apache2'
[Wed Apr 15 09:06:03.595211 2015] [mpm_prefork:notice] [pid 18029] AH00169: caught SIGTERM, shutting down
[Wed Apr 15 09:06:04.700631 2015] [mpm_prefork:notice] [pid 18173] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.7 configured -- resuming normal operations
[Wed Apr 15 09:06:04.700712 2015] [core:notice] [pid 18173] AH00094: Command line: '/usr/sbin/apache2'
[Wed Apr 15 09:06:17.015327 2015] [rewrite:error] [pid 18179] AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so th$
[Wed Apr 15 09:06:21.849123 2015] [rewrite:error] [pid 18179]  AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so th$
[Wed Apr 15 09:06:24.183721 2015] [rewrite:error] [pid 18179] AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so th$
[Wed Apr 15 09:06:28.557180 2015] [rewrite:error] [pid 18179]  AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so th$
[Wed Apr 15 09:06:30.376731 2015] [rewrite:error] [pid 18179]  AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so th$
[Wed Apr 15 09:06:31.039422 2015] [rewrite:error] [pid 18179]  AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so th$
[Wed Apr 15 09:06:31.648585 2015] [rewrite:error] [pid 18179]  AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so th$
[Wed Apr 15 09:06:32.192261 2015] [rewrite:error] [pid 18179]  AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so th$
Ultima modifica di Razvancs il mercoledì 15 aprile 2015, 14:32, modificato 1 volta in totale.
Razvancs
Prode Principiante
Messaggi: 7
Iscrizione: mercoledì 15 aprile 2015, 10:56
Distribuzione: 14.04
Sesso: Maschile

Re: mod_rewrite in Apache non funziona - Ubuntu Linux 14.04.

Messaggio da Razvancs »

in apache2 conf:

Codice: Seleziona tutto

<Directory />
	Options FollowSymLinks
	AllowOverride None
	Require all denied
</Directory>

<Directory /usr/share>
	AllowOverride None
	Require all granted
</Directory>

<Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
</Directory>
Avatar utente
jackynet92
Moderatore Globale
Moderatore Globale
Messaggi: 13413
Iscrizione: sabato 3 settembre 2011, 1:41
Desktop: Mate
Distribuzione: Ubuntu 16.04 64bit
Sesso: Maschile
Località: Torino

Re: mod_rewrite in Apache non funziona - Ubuntu Linux 14.04.

Messaggio da jackynet92 »

Modifica il penultimo post e aggiungi i tag code
Avatar utente
SuperStep
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 2037
Iscrizione: lunedì 19 dicembre 2011, 16:26
Desktop: Unity
Distribuzione: Ubuntu 16.04 LTS x86_64
Sesso: Maschile
Località: Somma Vesuviana (NA)

Re: mod_rewrite in Apache non funziona - Ubuntu Linux 14.04.

Messaggio da SuperStep »

a questo punto è saltato fuori l'errore:

AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so th$

Abilita uno dei due, hai il codice dell'errore, puoi sfruttare anche quello per una migliore ricerca in rete.
ubuntu 16.04 LTS 64-bit - Memoria: 31,3 Gib - Processore: Intel Core i7-5960X CPU @ 3.00 GHz × 16 - Grafica: AMD Radeon HD 7800 Series - Disco: SSD 256 GB x 4 (RAID 01)
Razvancs
Prode Principiante
Messaggi: 7
Iscrizione: mercoledì 15 aprile 2015, 10:56
Distribuzione: 14.04
Sesso: Maschile

Re: mod_rewrite in Apache non funziona - Ubuntu Linux 14.04.

Messaggio da Razvancs »

Adesso il codice e'

Codice: Seleziona tutto

<Directory /var/www/>
	Options Indexes FollowSymLinks
       AllowOverride All
        Require all granted 
</Directory>
Ricevo: Forbidden

You don't have permission to access / on this server.

Apache/2.4.7 (Ubuntu) Server Port 80 :muro: :muro:
Razvancs
Prode Principiante
Messaggi: 7
Iscrizione: mercoledì 15 aprile 2015, 10:56
Distribuzione: 14.04
Sesso: Maschile

Re: mod_rewrite in Apache non funziona - Ubuntu Linux 14.04.

Messaggio da Razvancs »

SOLVED!!!!!
/etc/apache2/sites-available/www.mydomain.com.conf

Codice: Seleziona tutto

allow from all
Options All (era' None)
Require all granted
OLE!!!!!! :birra: :birra: :birra: :birra: :birra:
Avatar utente
giulux
Amministratore
Amministratore
Messaggi: 25440
Iscrizione: domenica 10 gennaio 2010, 12:17
Desktop: ubuntu 18.04
Distribuzione: Ubuntu 18.04.3 LTS x86_64
Sesso: Maschile
Località: Roma

Re: mod_rewrite in Apache non funziona - Ubuntu Linux 14.04.

Messaggio da giulux »

Metti [Risolto] davanti al titolo del primo post.
Ciao
"Non è una segno di buona salute l'essere ben adattato ad una società malata". (Jiddu Krishnarmurti)
Scrivi risposta

Ritorna a “Ubuntu su server”

Chi c’è in linea

Visualizzano questa sezione: 0 utenti iscritti e 2 ospiti