Skip to main content

Enable IPv4-mapped addresses for Apache

Comments

7 comments

  • cPRex Jurassic Moderator
    Hey there! I'm not sure I understand the question - can you get me more details on what you're trying to do with Apache?
    0
  • awesomesites
    Thanks for the reply. This is the issue i am facing. My client's website went down when this is added to the .htaccess file Require all granted Require not env DenyAccess Require not ip ::ffff:X.X.X.X
    When i checked the error_log file, i can see that apache doesn't recognise IPv4 Mapped addresss .htaccess: ip address '::ffff:X.X.X.X' appears to be invalid: The specified IP address is invalid.
    I read online that this is due to apache not compiled with IPv4-mapped addresses enabled. So, i am wondering how can i do that.
    0
  • cPRex Jurassic Moderator
    Thanks for the additional details. Can you please run "httpd -V" on the system and see if you see the following line? -D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
    0
  • awesomesites
    Yes. Server loaded: APR 1.7.0, APR-UTIL 1.6.1, PCRE 8.32 2012-11-30 Compiled using: APR 1.7.0, APR-UTIL 1.6.1, PCRE 8.32 2012-11-30 Architecture: 64-bit Server MPM: event threaded: yes (fixed thread count) forked: yes (variable process count) Server compiled with.... -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses disabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=256 -D HTTPD_ROOT="/etc/apache2" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="/var/run/apache2/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf"
    0
  • cPRex Jurassic Moderator
    Thanks for the additional details. I spoke with our developers and confirmed this isn't something that is available on a cPanel machine. Since we don't include that, it would have to be compiled manually in a custom version of Apache. Is there a reason that user can't just use the IPv4 address in the .htaccess file?
    0
  • awesomesites
    Those are not entered manually. It is managed by a wordpress plugin. Right now we have disabled the feature to prevent the website from going down in the middle of the night when no one is monitoring. Do you have any articles on things to note when compiling a custom version of apache?
    0
  • cPRex Jurassic Moderator
    We don't recommend trying to use a custom Apache version on a cPanel machine. cPanel makes so many changes to that service that I wouldn't expect it to work well at all. I'd recommend not using that particular plugin, or contacting the developer of that plugin to see if there is a way to just have it list the IPv4 version of the address.
    0

Please sign in to leave a comment.