• RackNerd VPS running Centos 8, with Apache/MariaDB/PHP underlying WordPress. There is no cPanel access to the software running on the VPS.

    I have a test post which shows up when I connect to the base address.

    The problem is that attempting to preview the post from the editor, or attempting to access it from the “Recent posts” link on the home page, returns a 404 error (although the only thing shown is “File not found.” on the resulting page).

    Although I have more than 50 years’ experience in computing, and used to develop web pages in the late 1990s using Emacs to edit HTML directly, I am trying to move into the 21st Century with this experimental site. I have been unable to find any help via search engine queries, as everything I do find assumes that I am using a preconfigured cPanel system to install/update/control the site.

    I’m looking for suggestions as to what I have misconfigured to bring about this state of affairs.

    • This topic was modified 3 years, 3 months ago by t-p. Reason: Moved to Fixing WordPress from Localhost Installs

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator James Huff

    (@macmanx)

    Try re-saving your permalink structure at Settings > Permalinks in your Dashboard. If WordPress cannot automatically edit the .htaccess file, it will provide manual instructions after saving.

    Thread Starter rmalderson3

    (@rmalderson3)

    Thanks for the suggestion, but the change (and I did change to a custom value for testing purposes) had no effect on the “File not found” error.

    Moderator James Huff

    (@macmanx)

    Does the Apache configuration have mod_rewrite installed and running?

    Thread Starter rmalderson3

    (@rmalderson3)

    Yes. A grep of conf.modules.d/00-base-conf yields

    conf.modules.d/00-base.conf:LoadModule rewrite_module modules/mod_rewrite.so

    The .htaccess file contains

    
    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    • This reply was modified 3 years, 2 months ago by Yui. Reason: formatting
    Moderator James Huff

    (@macmanx)

    Hm, yes that _should_ work.

    Just wondering, does the option detailed here work? https://www.ads-software.com/support/article/using-permalinks/#pathinfo-almost-pretty

    Thread Starter rmalderson3

    (@rmalderson3)

    I assume that you mean inserting “/index.php” ahead of the date formatting entries in the custom format string.

    No, that made no difference.

    Moderator James Huff

    (@macmanx)

    Ok, so mod_rewrite is what makes the “pretty” permalinks (those without index.php) work.

    And, the “ugly” permalinks (those with index.php) are for server configurations without mod_rewrite.

    In other words, one of those is supposed to work, which makes me wonder if something critical is missing in the server config. I’m just not sure what though.

    Visit Tools > Site Health in your site’s Dashboard. What critical issues and recommended improvements are reported under Status?

    If you see just a check mark and “Great job!” there, please go to the Info tab next, click “Copy site info to clipboard,” and paste that here in a reply. (that tool was built specifically for this purpose, and as such does not reveal any sensitive info)

    • This reply was modified 3 years, 3 months ago by James Huff. Reason: typo
    Thread Starter rmalderson3

    (@rmalderson3)

    The server was DoS’d and unable to send/receive mail for a few days. Site Health complains about a 404 with regard to the REST API, and doesn’t seem to find ImageMagick although it is installed. I accept the inherent security risk of inactive themes and plugins, since this is still an experiment. See the site report below.

    One of the issues I have in attempting repairs is that very nearly every online resource assumes that WP is controlled via cPanel; it is not, so I cannot simply click on a button and magically fix a problem. I’ve even considered wiping the entire thing from the system (cf. “experiment”), but even the online help for that drastic measure assumes cPanel!

    Thanks for your patience.

    The following is the site report:

    
    ### wp-core ###
    
    version: 5.8.2
    site_language: en_US
    user_language: en_US
    timezone: America/Los_Angeles
    permalink: /index.php/%year%-%monthnum%-%day%/%postname%/
    https_status: true
    multisite: false
    user_registration: 1
    blog_public: 0
    default_comment_status: undefined
    environment_type: production
    user_count: 1
    dotorg_communication: true
    
    ### wp-paths-sizes ###
    
    wordpress_path: /var/www/html/wordpress
    wordpress_size: loading...
    uploads_path: /var/www/html/wordpress/wp-content/uploads
    uploads_size: loading...
    themes_path: /var/www/html/wordpress/wp-content/themes
    themes_size: loading...
    plugins_path: /var/www/html/wordpress/wp-content/plugins
    plugins_size: loading...
    database_size: loading...
    total_size: loading...
    
    ### wp-active-theme ###
    
    name: Twenty Twenty-One (twentytwentyone)
    version: 1.4
    author: the WordPress team
    author_website: https://www.ads-software.com/
    parent_theme: none
    theme_features: core-block-patterns, widgets-block-editor, automatic-feed-links, title-tag, post-formats, post-thumbnails, menus, html5, custom-logo, customize-selective-refresh-widgets, wp-block-styles, align-wide, editor-styles, editor-style, editor-font-sizes, custom-background, editor-color-palette, editor-gradient-presets, responsive-embeds, custom-line-height, experimental-link-color, custom-spacing, custom-units, widgets
    theme_path: /var/www/html/wordpress/wp-content/themes/twentytwentyone
    auto_update: Disabled
    
    ### wp-themes-inactive (6) ###
    
    Blank Canvas: version: 1.2.9, author: Automattic, Auto-updates disabled
    Blog Light: version: 0.0.9, author: themesmake, Auto-updates disabled
    RetroGeek: version: 0.5, author: tuxlog, Auto-updates disabled
    Seedlet: version: 1.1.13, author: Automattic, Auto-updates disabled
    Twenty Nineteen: version: 2.1, author: the WordPress team, Auto-updates disabled
    Twenty Twenty: version: 1.8, author: the WordPress team, Auto-updates disabled
    
    ### wp-plugins-active (3) ###
    
    Akismet Anti-Spam: version: 4.2.1, author: Automattic, Auto-updates enabled
    Classic Editor: version: 1.6.2, author: WordPress Contributors, Auto-updates enabled
    Limit Login Attempts Reloaded: version: 2.23.2, author: Limit Login Attempts Reloaded, Auto-updates enabled
    
    ### wp-plugins-inactive (1) ###
    
    WordPress Backup & Migration: version: 1.3.3, author: WebToffee, Auto-updates enabled
    
    ### wp-media ###
    
    image_editor: WP_Image_Editor_GD
    imagick_module_version: Not available
    imagemagick_version: Not available
    imagick_version: Not available
    file_uploads: File uploads is turned off
    post_max_size: 48M
    upload_max_filesize: 32M
    max_effective_size: 32 MB
    max_file_uploads: 20
    gd_version: 2.2.5
    gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
    ghostscript_version: not available
    
    ### wp-server ###
    
    server_architecture: Linux 4.18.0-305.12.1.el8_4.x86_64 x86_64
    httpd_software: Apache/2.4.37 (centos) OpenSSL/1.1.1k
    php_version: 7.4.26 64bit
    php_sapi: fpm-fcgi
    max_input_variables: 1000
    time_limit: 600
    memory_limit: 256M
    max_input_time: 1000
    upload_max_filesize: 32M
    php_post_max_size: 48M
    curl_version: 7.61.1 OpenSSL/1.1.1k
    suhosin: false
    imagick_availability: false
    pretty_permalinks: true
    
    ### wp-database ###
    
    extension: mysqli
    server_version: 10.3.28-MariaDB
    client_version: mysqlnd 7.4.26
    
    ### wp-constants ###
    
    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /var/www/html/wordpress/wp-content
    WP_PLUGIN_DIR: /var/www/html/wordpress/wp-content/plugins
    WP_MEMORY_LIMIT: 40M
    WP_MAX_MEMORY_LIMIT: 256M
    WP_DEBUG: false
    WP_DEBUG_DISPLAY: true
    WP_DEBUG_LOG: false
    SCRIPT_DEBUG: false
    WP_CACHE: false
    CONCATENATE_SCRIPTS: undefined
    COMPRESS_SCRIPTS: undefined
    COMPRESS_CSS: undefined
    WP_LOCAL_DEV: undefined
    DB_CHARSET: utf8mb4
    DB_COLLATE: undefined
    
    ### wp-filesystem ###
    
    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable
    
    • This reply was modified 3 years, 2 months ago by Yui. Reason: formatting
    Thread Starter rmalderson3

    (@rmalderson3)

    Apparently I have gmagick installed rather than ImageMagick; this may have been due to an issue in Centos 8 when I was setting things up. It’s not clear to me whether WP does not work with gmagick.

    Moderator Yui

    (@fierevere)

    永子

    Does your httpd.conf (or its parts) permit

    AllowOverride All

    to enable .htaccess mod_rewrite directives?
    https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride

    Yes. A grep of conf.modules.d/00-base-conf yields

    conf.modules.d/00-base.conf:LoadModule rewrite_module modules/mod_rewrite.so

    Is it enabled? try a2enmod (or alternative on CentOS), it will create link to conf.avail (or whatever its called in CentOS), you have to reload Apache after enabling it.

    Little fast-googled-howto:

    Apache rewrite module allows URL rewriting. It’s enabled by Default in Centos 7. Check if it’s already enabled in your version. The following command outputs a list of Apache modules that are currently enabled:

    httpd -M

    If it is not already enabled, you will need to enable it by modifying the configuration file

    sudo nano /etc/httpd/conf.modules.d/00-base.conf

    and include the following line

    LoadModule rewrite_module modules/mod_rewrite.so

    Save the file and restart the Apache server

    sudo systemctl restart httpd

    —–

    It’s not clear to me whether WP does not work with gmagick.

    They are somewhat compatible, the question is if PHP Imagick extension can be linked with GMagick libraries, there is GMagick PHP extension as well, but it will not work with WordPress Image Editor class.

    Refer to phpinfo() output if you have ImageMagick there

    • This reply was modified 3 years, 2 months ago by Yui.
    • This reply was modified 3 years, 2 months ago by Yui.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If you’re not getting responses, correct or not, from .htaccess, it may be because it’s disabled. In your <VirtualHost...> stanza for this site in the httpd config, add

    <Directory /path/to/wordpress>
       AllowOverride All
    </Directory>

    then restart httpd.

    Thread Starter rmalderson3

    (@rmalderson3)

    I’ve just added

    <Directory /var/www/html/wordpress>
    AllowOverride all
    </Directory>

    to httpd.conf and restarted httpd, without changing the result.

    At this point, I would prefer to stop trying to fix this broken installation and start over. As I noted previously, all of the how-tos I’ve found online assume that there is a cPanel button for doing this, and do not provide actual details on what needs to be deleted/modified to allow this. Pointers would be appreciated.

    Thanks.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Unable to preview/link to existing post’ is closed to new replies.