# Cohabitation 2 sites wordpress sur Apache 2.4

**URL:** <https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269>\
**Category:** Support Debian\
**Tags:** apache\
**Created:** [Octobre 12, 2022, 1:53 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269 "2022-10-12T13:53:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 12, 2022, 1:53 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/1 "2022-10-12T13:53:49Z")

</div>

Bonjour à tous,

Je suis actuellement en train d’essayer de faire cohabiter 2 site Wordpress par le biais d’une machine Debian 11 et Apache2.

Pas de problème pour le déploiement de ceux-ci. Ils se trouvent dans cette arbo :

> var/www/html/monsite1  
> var/www/html/monsite2

Les 2 site ont un nom de domaine avec 2 virtual host :

monsite1.conf  
monsite2.conf  
/etc/apache2/sites-enabled/monsite1.conf  
/etc/apache2/sites-enabled/monsite2.conf

```
<VirtualHost ip:80>
	ServerName monsite1.com
	Redirect permanent / https://monsite1.com
</VirtualHost>

<VirtualHost ip:443>
	ServerName monsite1.com
	ServerAdmin webmaster@monsite1
  DocumentRoot /var/www/html/monsite1

	    <IfModule mod_dav.c>
  		Dav off
			</IfModule> 

```

```
<VirtualHost ip:80>
	ServerName monsite2.com
	Redirect permanent / https://monsite2.com
</VirtualHost>

<VirtualHost ip:443>
	ServerName monsite2.com
	ServerAdmin webmaster@monsite2
  DocumentRoot /var/www/html/monsite2

	    <IfModule mod_dav.c>
  		Dav off
			</IfModule> 

```

Tout vas bien mais lorsque je pointe sur les noms de domaines, j’ai le nom du dossier qui apparait dans l’URL

nomdedomain/monsite1  
nomdedomaine/monsite2

J’ai trouvé une solution qui marche pour un seul site :

-Déplacer index.php avec le .htaccess du dossier monsite à la racine de www/html et d’y rajouter le chemin :

> /\*\* Loads the WordPress Environment and Template \*/  
> require **DIR**. ‹&nbsp; **monsite1** /wp-blog-header.php&nbsp;›;

Mais je n’ai pas la possibilité pour le faire pour le second dans la mesure ou je me retrouverai avec 2 index.php sous la main.

Vers quel solution dois-je me tourner pour supprimer [https://monsite2.com/\*\*monsite2](https://monsite2.com/**monsite2)\*\* sans bousculer monsite1.  
Je suis néophyte mais ce que j’ai trouvé sur le net ne m’aiguille pas beaucoup. Dois-je m’aider d’un fichier .htaccess ?

Merci à tous

---

<div class="post-metadata">

**Author:** ![Zargos](https://www.debian-fr.org/user_avatar/www.debian-fr.org/zargos/32/10889_2.png) [@Zargos](https://www.debian-fr.org/u/Zargos)\
**Post date:** [Octobre 12, 2022, 2:24 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/2 "2022-10-12T14:24:38Z")

</div>

> [@Morales](#):
>
> J’ai trouvé une solution qui marche pour un seul site :
> 
> -Déplacer index.php avec le .htaccess du dossier monsite à la racine de www/html et d’y rajouter le chemin :
> 
> > /\*\* Loads the WordPress Environment and Template \*/  
> > require **DIR**. ‹ **monsite1** /wp-blog-header.php ›;

Bonjour,  
non ça c’est de l’usine à gaz.

> [@Morales](#):
>
> ```auto
> <VirtualHost ip:443>
> ServerName monsite1.com
> ServerAdmin webmaster@monsite1
> DocumentRoot /var/www/html/monsite1
> 
> <IfModule mod_dav.c>
> Dav off
> </IfModule> 
> 
> ```

il manque le `</VirtualHost>` sur tes deux sites HTTPS.  
Aussi, met plutot:  
`<Virtualhost *:80>`  
Ne met pas l’ip si tu travaille sur des host virtuel pointant sur le domain name.  
Comment sont déclarés [monsite1.com](http://monsite1.com) et [monsite2.com](http://monsite2.com) dans le DNS?

---

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 12, 2022, 4:06 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/3 "2022-10-12T16:06:24Z")

</div>

Merci pour ta réponse Zargos,

Merci de la correction pour le

\< /VirtualHost\>

mais lorsque je met ces balises, Apache2 ne se reload pas malgré la vérification de la balise.

Quant au DNS il sont déclaré comme ceci

Type A @ ip  
Type A www ip

Bien à vous

---

<div class="post-metadata">

**Author:** ![Zargos](https://www.debian-fr.org/user_avatar/www.debian-fr.org/zargos/32/10889_2.png) [@Zargos](https://www.debian-fr.org/u/Zargos)\
**Post date:** [Octobre 12, 2022, 4:08 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/4 "2022-10-12T16:08:43Z")

</div>

> [@Morales](#):
>
> Merci pour la correction au niveau pour le mais lorsque je met ces balises, Apache2 ne se reload pas malgré la vérification de la balise.

Quelle correction et quel message de Apache?

---

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 12, 2022, 6:26 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/5 "2022-10-12T18:26:57Z")

</div>

La correction pour le Virtualhost Je ne comprend pas cette histoire de without \>

 ![image](https://www.debian-fr.org/uploads/default/original/2X/4/4357b974f4aaf5ea22d12e17026c63f505afd09f.png)

---

<div class="post-metadata">

**Author:** ![Zargos](https://www.debian-fr.org/user_avatar/www.debian-fr.org/zargos/32/10889_2.png) [@Zargos](https://www.debian-fr.org/u/Zargos)\
**Post date:** [Octobre 12, 2022, 6:30 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/6 "2022-10-12T18:30:21Z")

</div>

Fait des copier coller du texte.  
Les captures d’écran sont difficiles à utiliser.  
fait nous un copier coller de ton fichier de configuration de site (de sites-available et non pas de sites-enabled); le fichier complet car il y a quand même 142 lignes dans ce fichier, ce qui ne correspond pas à ce que tu nous a montré dans la conversation.

---

<div class="post-metadata">

**Author:** ![Clochette](https://www.debian-fr.org/user_avatar/www.debian-fr.org/clochette/32/8757_2.png) [@Clochette](https://www.debian-fr.org/u/Clochette)\
**Post date:** [Octobre 12, 2022, 6:38 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/7 "2022-10-12T18:38:19Z")

</div>

Si tu as accès à la gestion dns ajoute simplement un CNAME en staging.ton\_nom\_de\_domaine.tld et fais pointé ton futur domaine dessus, une fois que tout est correct tu inverse tes _server name_ et \*alias \*

- name\* entre tes deux vhost …

---

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 12, 2022, 6:40 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/8 "2022-10-12T18:40:42Z")

</div>

Autant pour moi, j’avais laissé trainé une balise sur les deux VirtualHost.  
J’ai également remplacé l’ip par les \* comme tu m’as recommandé.

Tout est work et ca m’a fixé un problème de SSL par la meme occasion, je t’en remercie.  
Je reviens donc à ma première problématique de pouvoir me séparer du nom de dossier dans l’URL de mon DNS.

Merci

```
<VirtualHost *:80>
	ServerName monsite1
	Redirect permanent / https://monsite1.com
</VirtualHost>

<VirtualHost *:443>
	ServerName monsite1.com
	ServerAdmin webmaster@monsite1
  DocumentRoot /var/www/html/monsite1

```

```
	    <IfModule mod_dav.c>
  		Dav off
			</IfModule>

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf

	# SSL Engine Switch:
	# Enable/Disable SSL for this virtual host.
	SSLEngine on

	# A self-signed (snakeoil) certificate can be created by installing
	# the ssl-cert package. See
	# /usr/share/doc/apache2/README.Debian.gz for more info.
	# If both key and certificate are stored in the same file, only the
	# SSLCertificateFile directive is needed.
	SSLCertificateFile	/etc/ssl/certs/suzhy-easycv.com_ssl_certificate.cer
	SSLCertificateKeyFile /etc/ssl/private/_.suzhy-easycv.com_private_key.key

	# Server Certificate Chain:
	# Point SSLCertificateChainFile at a file containing the
	# concatenation of PEM encoded CA certificates which form the
	# certificate chain for the server certificate. Alternatively
	# the referenced file can be the same as SSLCertificateFile
	# when the CA certificates are directly appended to the server
	# certificate for convinience.
	#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

	# Certificate Authority (CA):
	# Set the CA certificate verification path where to find CA
	# certificates for client authentication or alternatively one
	# huge file containing all of them (file must be PEM encoded)
	# Note: Inside SSLCACertificatePath you need hash symlinks
	# to point to the certificate files. Use the provided
	# Makefile to update the hash symlinks after changes.
	#SSLCACertificatePath /etc/ssl/certs/
	#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

	# Certificate Revocation Lists (CRL):
	# Set the CA revocation path where to find CA CRLs for client
	# authentication or alternatively one huge file containing all
	# of them (file must be PEM encoded)
	# Note: Inside SSLCARevocationPath you need hash symlinks
	# to point to the certificate files. Use the provided
	# Makefile to update the hash symlinks after changes.
	#SSLCARevocationPath /etc/apache2/ssl.crl/
	#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

	# Client Authentication (Type):
	# Client certificate verification type and depth. Types are
	# none, optional, require and optional_no_ca. Depth is a
	# number which specifies how deeply to verify the certificate
	# issuer chain before deciding the certificate is not valid.
	#SSLVerifyClient require
	#SSLVerifyDepth 10

	# SSL Engine Options:
	# Set various options for the SSL engine.
	# o FakeBasicAuth:
	# Translate the client X.509 into a Basic Authorisation. This means that
	# the standard Auth/DBMAuth methods can be used for access control. The
	# user name is the `one line' version of the client's X.509 certificate.
	# Note that no password is obtained from the user. Every entry in the user
	# file needs this password: `xxj31ZMTZzkVA'.
	# o ExportCertData:
	# This exports two additional environment variables: SSL_CLIENT_CERT and
	# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
	# server (always existing) and the client (only existing when client
	# authentication is used). This can be used to import the certificates
	# into CGI scripts.
	# o StdEnvVars:
	# This exports the standard SSL/TLS related `SSL_*' environment variables.
	# Per default this exportation is switched off for performance reasons,
	# because the extraction step is an expensive operation and is usually
	# useless for serving static content. So one usually enables the
	# exportation for CGI and SSI requests only.
	# o OptRenegotiate:
	# This enables optimized SSL connection renegotiation handling when SSL
	# directives are used in per-directory context.
	#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
	<FilesMatch "\.(cgi|shtml|phtml|php)$">
			SSLOptions +StdEnvVars
	</FilesMatch>
	<Directory /usr/lib/cgi-bin>
			SSLOptions +StdEnvVars
	</Directory>

	# SSL Protocol Adjustments:
	# The safe and default but still SSL/TLS standard compliant shutdown
	# approach is that mod_ssl sends the close notify alert but doesn't wait for
	# the close notify alert from client. When you need a different shutdown
	# approach you can use one of the following variables:
	# o ssl-unclean-shutdown:
	# This forces an unclean shutdown when the connection is closed, i.e. no
	# SSL close notify alert is send or allowed to received. This violates
	# the SSL/TLS standard but is needed for some brain-dead browsers. Use
	# this when you receive I/O errors because of the standard approach where
	# mod_ssl sends the close notify alert.
	# o ssl-accurate-shutdown:
	# This forces an accurate shutdown when the connection is closed, i.e. a
	# SSL close notify alert is send and mod_ssl waits for the close notify
	# alert of the client. This is 100% SSL/TLS standard compliant, but in
	# practice often causes hanging connections with brain-dead browsers. Use
	# this only for browsers where you know that their SSL implementation
	# works correctly.
	# Notice: Most problems of broken clients are also related to the HTTP
	# keep-alive facility, so you usually additionally want to disable
	# keep-alive for those clients, too. Use variable "nokeepalive" for this.
	# Similarly, one has to force some clients to use HTTP/1.0 to workaround
	# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
	# "force-response-1.0" for this.
	# BrowserMatch "MSIE [2-6]" \
	# nokeepalive ssl-unclean-shutdown \
	# downgrade-1.0 force-response-1.0

```

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

---

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 12, 2022, 6:44 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/9 "2022-10-12T18:44:55Z")

</div>

Salut Clochette,

Oui j’ai accès a la gestion de mon DNS, je ne suis pas encore familier avec les CNAME et les TLD. Je vais me documenter un peu. Merci pour la piste.  
Quand tu parles de futur nom de domaine c’est ceux que je pourrais ajouté sur le LAMP ?

Je rajoute la ligne ServerAlias en y ajoutant staging.monsite.com.tld ?

---

<div class="post-metadata">

**Author:** ![Zargos](https://www.debian-fr.org/user_avatar/www.debian-fr.org/zargos/32/10889_2.png) [@Zargos](https://www.debian-fr.org/u/Zargos)\
**Post date:** [Octobre 12, 2022, 6:46 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/10 "2022-10-12T18:46:50Z")

</div>

D’où sorts tu ton fichier à l’origine? c’est un fichier que tu as récupéré de quelle configuration?  
car la partie sur le Dav n’a rien à y faire  
il est mal structuré.  
Tu devrait juste avoir:

```auto
<VirtualHost *:80>
	ServerName monsite1
	Redirect permanent / https://monsite1.com
</VirtualHost>

<VirtualHost *:443>

	ServerName monsite1.com
	ServerAdmin webmaster@monsite1
        DocumentRoot /var/www/html/monsite1

    <DocumentRoot /var/www/html/monsite1>

    ErrorLog ${APACHE_LOG_DIR}/error-monsite1.log
    CustomLog ${APACHE_LOG_DIR}/access-monsite1.log combined

        SSLEngine on
	SSLCertificateFile	/etc/ssl/certs/suzhy-easycv.com_ssl_certificate.cer
	SSLCertificateKeyFile /etc/ssl/private/_.suzhy-easycv.com_private_key.key

    <Directory "/var/www/monsite1">
        AllowOverride None
        Options -FollowSymLinks
        allow from all
    </Directory>
</VirtualHost>

```

---

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 12, 2022, 6:49 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/11 "2022-10-12T18:49:37Z")

</div>

C’est le fichier de base auquel j’ai décommenté et que j’ai dupliqué pour m’en reservir

---

<div class="post-metadata">

**Author:** ![Zargos](https://www.debian-fr.org/user_avatar/www.debian-fr.org/zargos/32/10889_2.png) [@Zargos](https://www.debian-fr.org/u/Zargos)\
**Post date:** [Octobre 12, 2022, 6:55 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/12 "2022-10-12T18:55:59Z")

</div>

quel fichier de base?  
Dav n’est pas utilisé de base pour un site.

---

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 12, 2022, 7:08 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/13 "2022-10-12T19:08:28Z")

</div>

Je l’ai surement repris ailleurs alors. Je vais l’optimiser merci de la recommandation.

Pour explorer la piste de clochette.  
Sur la doc d’Apache2

\< VirtualHost \>  
DocumentRoot «&nbsp;/www/html/monsite1&nbsp;»  
ServerName [monsite1.com](http://monsite1.com)  
ServerAlias monsite1  
\< /VirtualHost\>

La syntaxe est-elle correcte ? j’ai du mal à saisir le ServerAlias _server_ avec le CNAME :

hote : staging.monsite1.com.tld  
qui pointe vers [monsite1.com](http://monsite1.com)

Bien à vous

---

<div class="post-metadata">

**Author:** ![Zargos](https://www.debian-fr.org/user_avatar/www.debian-fr.org/zargos/32/10889_2.png) [@Zargos](https://www.debian-fr.org/u/Zargos)\
**Post date:** [Octobre 12, 2022, 7:45 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/14 "2022-10-12T19:45:04Z")

</div>

> [@Morales](#):
>
> hote : staging.monsite1.com.tld  
> qui pointe vers [monsite1.com](http://monsite1.com)

Euh.. Désolé mais .tld n’est pas un … tld justement.  
faute de frappe 🙂 [staging.monsite1.com](http://staging.monsite1.com)  
n’utilise as ServerAlias car c’est à cause de ça que tu te retrouve avec le répertoire derrière [monsite1.com](http://monsite1.com).  
et virtualhost tout seul ce n’est pas bon non plus.

As-tu essayé la conf que je t’ai donné ? car normalement elle devrait marcher.

---

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 12, 2022, 8:38 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/15 "2022-10-12T20:38:53Z")

</div>

Merci Zargos de toutes tes réponses.

Je viens d’essayer ta config et il me demande de fermer la balise DocumentRoot

● apache2.service - The Apache HTTP Server  
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)  
Active: failed (Result: exit-code) since Wed 2022-10-12 20:38:05 UTC; 5s ago  
Docs: [Apache HTTP Server Version 2.4 Documentation - Apache HTTP Server Version 2.4](https://httpd.apache.org/docs/2.4/)  
Process: 239216 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)  
CPU: 17ms

Oct 12 20:38:05 ns3077450 systemd[1]: Starting The Apache HTTP Server…  
Oct 12 20:38:05 ns3077450 apachectl[239219]: apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on line 26 of /etc/apache2/sites-enabled/suzhy.conf: Expected but s\>  
Oct 12 20:38:05 ns3077450 apachectl[239216]: Action ‹&nbsp;start&nbsp;› failed.  
Oct 12 20:38:05 ns3077450 apachectl[239216]: The Apache error log may have more information.  
Oct 12 20:38:05 ns3077450 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE  
Oct 12 20:38:05 ns3077450 systemd[1]: apache2.service: Failed with result ‹&nbsp;exit-code&nbsp;›.  
Oct 12 20:38:05 ns3077450 systemd[1]: Failed to start The Apache HTTP Server.  
lines 1-14/14 (END)

---

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 13, 2022, 9:16 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/16 "2022-10-13T09:16:35Z")

</div>

Bonjour Zargos,

Dans la conf que tu m’as donné c’est ce bout de code qui est censé supprimé le dossier de monsite ?

\< Directory «&nbsp;/var/www/monsite1&nbsp;»\>  
AllowOverride None  
Options -FollowSymLinks  
allow from all  
\< /Directory\>

En te remerciant,

---

<div class="post-metadata">

**Author:** ![Zargos](https://www.debian-fr.org/user_avatar/www.debian-fr.org/zargos/32/10889_2.png) [@Zargos](https://www.debian-fr.org/u/Zargos)\
**Post date:** [Octobre 13, 2022, 2:16 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/17 "2022-10-13T14:16:23Z")

</div>

> [@Morales](#):
>
> Je viens d’essayer ta config et il me demande de fermer la balise DocumentRoot

C’est une erreur, j’ai répété deux fois la même ligne.  
C’est juste:

```auto
DocumentRoot /var/www/html/monsite1

```

cette option définie la racine des fichiers du site.  
ServerName definit l’URL qui sera traité par le virtual host.  
Ensuite Directory definit comment les accès sont réalisés dans la hierarchie du site. c’est l’ensemble en fait.  
L’histoire de la visibilité sous forme arborescente est plus souvent associée à une conf (conf-avalable, a2enconf) qu’à un virtual host (sites-available, a2ensite).

---

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 13, 2022, 3:12 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/18 "2022-10-13T15:12:13Z")

</div>

Hola Zargos,

J’ai pas mal bidouillé et je n’arrive plus à afficher les images de mes sites web.

J’ai essayer ta config et vérifier apache2.conf et dans le directory j’ai bien :

\<Directory /var/www/html\>  
DirectoryIndex index.php  
Options Indexes FollowSymLinks  
AllowOverride all  
Require all granted

Et j’ai essayé ta config mais je n’ai plus aucune image qui charge correctement.

Je me pose la question de tout reinstaller

---

<div class="post-metadata">

**Author:** ![Clochette](https://www.debian-fr.org/user_avatar/www.debian-fr.org/clochette/32/8757_2.png) [@Clochette](https://www.debian-fr.org/u/Clochette)\
**Post date:** [Octobre 13, 2022, 4:29 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/19 "2022-10-13T16:29:11Z")

</div>

> [@Morales](#):
>
> Et j’ai essayé ta config mais je n’ai plus aucune image qui charge correctement.

Le chemins pour atteindre les images a t’il changé ? .

Tu as quoi dans les logs apache ?

---

<div class="post-metadata">

**Author:** ![Morales](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@Morales](https://www.debian-fr.org/u/Morales)\
**Post date:** [Octobre 14, 2022, 11:47 UTC](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269/20 "2022-10-14T11:47:02Z")

</div>

Hola Clochette,

J’ai finalement tout réinstaller parce que je pense que ma base de donnée était corrompue.  
Je tente de migrer mes sauvegarde de wordpress. J’ai réussi à remplacer quasi tout les liens mais je n’arrive pas à trouver comment remplacer le wp-content/upload

J’ai lancé cette requête depuis phpmyadmin

```auto
UPDATE `wp_options` SET option_value = replace(option_value, 'https://www.ancienne.com', 'https://www.nouvelle.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE `wp_posts` SET guid = replace(guid, 'https://www.ancienne.com','https://www.nouvelle.com');
UPDATE `wp_posts` SET post_content = replace(post_content, 'https://www.ancienne.com', 'https://www.nouvelle.com');
UPDATE `wp_postmeta` SET meta_value = replace(meta_value,'https://www.ancienne.com','https://www.nouvelle.com');
UPDATE `wp_links` SET link_url = replace(link_url,'https://www.ancienne.com', 'https://www.nouvelle.com');

```

Mais toute les images uploads ne sont pas prit en compte.

Avez vous une idée pour remplacer ça sans passer par de plugin ?

En vous remerciant

[Page suivante](https://www.debian-fr.org/t/cohabitation-2-sites-wordpress-sur-apache-2-4/87269.md?page=2)
