[Risolto] Apache-Wordpress

Ciao a tutti,
Ancora una volta a chiedere il vostro prezioso aiuto.

Sto cercando di configurare wordpress su fedora 14.
Ho seguito un po’ di guide sparse per il web, credo di aver fatto il 90% del lavoro, il problema è che non so cosa manchi ancora.
Ricapitolando i passi:

  1. download file wordpress- estrazione -creata nuova cartella wordpress
    2)creato file wp-config.php con credenziali DB_USER, DB_Name–pass…ecc

3)spostato file su var/www/html/wordpress ovviamente LAMP è stato instalato precedentemente.

  1. cambiati diritti chown -R apache:apache *
    chmod -R 777 wordpress/

5)[root@localhost html]# ls -lart
totale 16
drwxr-xr-x. 6 root root 4096 27 ott 2010 …
-rw-r–r--. 1 apache apache 19 14 mar 2011 info.php
drwxrwxrwx. 5 apache apache 4096 14 nov 17.47 wordpress
drwxr-xr-x. 3 root root 4096 14 nov 18.14 .

Tutto questo per dire che se sul browser vado su http://localhost/wordpress ottengo un bel

[code]Forbidden

You don’t have permission to access /wordpress/wp-admin/ on this server.
Apache/2.2.17 (Fedora) Server at localhost Port 80[/code]

PS: lo stesso vale anche con http://localhost/wordpress/wp-admin/install.php

Grazie in anticipo

e se aggiungi il tuo utente al gruppo apache ?

Fatto:

[root@localhost /]# gpasswd -a ZEP wheel Adding user ZEP to group wheel [root@localhost /]# gpasswd -a ZEP apache Adding user ZEP to group apache

Niente da fare…

http://localhost/wordpress -

[code]Forbidden

You don’t have permission to access /wordpress on this server.
Apache/2.2.17 (Fedora) Server at localhost Port 80[/code]

Lo stato si SELinux?

Ciao MarioS,

è abilitato, cmq posto l’output

[code][root@localhost selinux]# more config

This file controls the state of SELinux on the system.

SELINUX= can take one of these three values:

enforcing - SELinux security policy is enforced.

permissive - SELinux prints warnings instead of enforcing.

disabled - No SELinux policy is loaded.

SELINUX=enforcing

SELINUXTYPE= can take one of these two values:

targeted - Targeted processes are protected,

mls - Multi Level Security protection.

SELINUXTYPE=targeted
[/code]

disabilita temporaneamente Selinux, modificando la linea SELINUX=enforcing
in:
SELINUX=disabled
poi dai un reboot.

E’ andato :ok:

La prova:

Benvenuto

Benvenuti nella famosa procedura dei cinque minuti 
per l’installazione di WordPress! Potreste voler 
scorrere la documentazione in Leggimi. Altrimenti, 
indicare le seguenti informazioni e sarete sulla 
strada per utilizzare la più estensibile e potente 
piattaforma di editoria personale del mondo.

Domanda…da neofita…come mai Selinux non mi dava problemi in localhost con la pagina di info.php e di phpmyadmin…e invece me li dava con wordpress?

Grazie MarioS,Virus per l’ennesimo prezioso aiuto :slight_smile:

con ogni probabilità le politiche di Selinux non includono Wordpress ed occorre dirglielo a “manina”.

Ah OK…adesso provo a riabiltarlo.

Grazie…Ciaooo

se lo riabiliti, con ogni probabilità ti impedisce di nuovo di procedere.
occorre indicare una politica di comportamento di selinux riguardante wordpress ed i suoi files.

Ho preso spunto da quello che hai scritto e ho spulciato il web :slight_smile:

e quindi ho trovato il comando chcon che cambia il contesto di SELinux per i file

Infatti prima avevo:

[root@localhost /]# ls -aZ /var/www/html/ drwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 . drwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 .. -rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 info.php drwxrwxrwx. apache apache unconfined_u:object_r:user_home_t:s0 wordpress

Ho dato il comando

[root@localhost /]# chcon -R -t httpd_sys_content_t /var/www/html/wordpress/

Output:

[root@localhost /]# ls -aZ /var/www/html/ drwxr-xr-x.
root   root   system_u:object_r:httpd_sys_content_t:s0 . 
drwxr-xr-x. root   root system_u:object_r:httpd_sys_content_t:s0 
.. -rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 info.php
drwxrwxrwx. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wordpress

Ho riabilitato Selinux ed è tutto :ok:
Una atro passeto avanti grazie a voi :smiley: