Skip to content

configure ghost and wordpress combo

Moved Solved WordPress
9 3 3.3k 1
  • wrote on last edited by
    #1

    Hello, I am trying to configure Ghost and WordPress, but I’m stuck on the Nginx configuration and SSL setup. With the help of ChatGPT, I installed PHP 8.3 and WordPress, but when I access wp.domain.com, it still loads domain.com (Ghost). I think I may have made a mistake somewhere. Where should I check for the issue?

  • wrote on last edited by
    #3

    Did you also add wp.domain.com as an A record in your domain registry to point to your server IP? There are probably other ways of doing this as well. Whether you are using the DNS on the hosting provider to manage your dns or you go to where you have your domain registered, there you can usually add the wp.domain.com as an A record pointing to your server’s public IP address. Then it may take a little time for that to propagate out so you can ping wp.domain.com and see the ip address you added. I apologize if this sounds a little confusing.

    I usually have it setup in it’s own .conf file with the root entry pointing/to/your/folder.

    So example you have:

    server {
        listen 80;
        server_name wp.domain.com;
        root /path/to/your/subdomain/folder
    
        Then the rest of your setup here . . .
    }
    

    Then don’t forget to use

    sudo ln -s /etc/nginx/sites-available/yourfilename.conf /etc/nginx/sites-enabled/yourfilename.conf
    

    You will also need to restart your nginx server sudo systemctl restart nginx

    If you want to post your conf file we can take a look at it as well.

  • Hello, I am trying to configure Ghost and WordPress, but I’m stuck on the Nginx configuration and SSL setup. With the help of ChatGPT, I installed PHP 8.3 and WordPress, but when I access wp.domain.com, it still loads domain.com (Ghost). I think I may have made a mistake somewhere. Where should I check for the issue?

    wrote on last edited by
    #2

    @Hari do you have seperate nginx.conf does for each domain?

  • phenomlab phenomlab moved this topic from Networks on
  • wrote on last edited by
    #3

    Did you also add wp.domain.com as an A record in your domain registry to point to your server IP? There are probably other ways of doing this as well. Whether you are using the DNS on the hosting provider to manage your dns or you go to where you have your domain registered, there you can usually add the wp.domain.com as an A record pointing to your server’s public IP address. Then it may take a little time for that to propagate out so you can ping wp.domain.com and see the ip address you added. I apologize if this sounds a little confusing.

    I usually have it setup in it’s own .conf file with the root entry pointing/to/your/folder.

    So example you have:

    server {
        listen 80;
        server_name wp.domain.com;
        root /path/to/your/subdomain/folder
    
        Then the rest of your setup here . . .
    }
    

    Then don’t forget to use

    sudo ln -s /etc/nginx/sites-available/yourfilename.conf /etc/nginx/sites-enabled/yourfilename.conf
    

    You will also need to restart your nginx server sudo systemctl restart nginx

    If you want to post your conf file we can take a look at it as well.

  • Hari Hari has marked this topic as solved on
  • Did you also add wp.domain.com as an A record in your domain registry to point to your server IP? There are probably other ways of doing this as well. Whether you are using the DNS on the hosting provider to manage your dns or you go to where you have your domain registered, there you can usually add the wp.domain.com as an A record pointing to your server’s public IP address. Then it may take a little time for that to propagate out so you can ping wp.domain.com and see the ip address you added. I apologize if this sounds a little confusing.

    I usually have it setup in it’s own .conf file with the root entry pointing/to/your/folder.

    So example you have:

    server {
        listen 80;
        server_name wp.domain.com;
        root /path/to/your/subdomain/folder
    
        Then the rest of your setup here . . .
    }
    

    Then don’t forget to use

    sudo ln -s /etc/nginx/sites-available/yourfilename.conf /etc/nginx/sites-enabled/yourfilename.conf
    

    You will also need to restart your nginx server sudo systemctl restart nginx

    If you want to post your conf file we can take a look at it as well.

    wrote on last edited by
    #4

    @Madchatthew, thanks! I’ve set up Nginx and added SSL for both domains.

    At first, I used DigitalOcean’s one-click setup to install Ghost on domain.com. Later, I also installed Ghost on domain2.com, and that worked without any issues.

    But when I tried setting up wp.domain.com for WordPress, it kept redirecting to domain2.com instead of wp.domain.com after doing all the ngnix settings.

    I gave up on that setup and tried installing WordPress on another droplet with a LEMP stack, but I ran into an issue with the upload file size limit. I might chose to Hostinger for hosting WordPress instead.

  • @Madchatthew, thanks! I’ve set up Nginx and added SSL for both domains.

    At first, I used DigitalOcean’s one-click setup to install Ghost on domain.com. Later, I also installed Ghost on domain2.com, and that worked without any issues.

    But when I tried setting up wp.domain.com for WordPress, it kept redirecting to domain2.com instead of wp.domain.com after doing all the ngnix settings.

    I gave up on that setup and tried installing WordPress on another droplet with a LEMP stack, but I ran into an issue with the upload file size limit. I might chose to Hostinger for hosting WordPress instead.

    wrote on last edited by
    #5

    @Hari said in configure ghost and wordpress combo:

    But when I tried setting up wp.domain.com for WordPress, it kept redirecting to domain2.com instead of wp.domain.com after doing all the ngnix settings.

    I might have more detail that you need, but I am not sure how your setup is currently. So I intend no offense if I am describing things in more detail than you need.

    So are you controlling your DNS records through DigitalOcian or through the company that you purchased your domain name through? Which ever way you are managing your DNS, you will need to add an A record wp.domain.com that points to your server’s IP address, and a CNAME for www.wp.domain.com that points to your wp.domain.com A record. You would set this up just like you did for the main domains, but the subdomain is in with the rest of the DNS settings that you have your domain.com.

    When you are setting up Nginx conf file for wp.domain.com (this should be it’s own conf file), you do need some extra settings in there in order for Nginx to work with Wordpress.

    Depending on where you are storing your wordpress files, /var/www/domain.com as an example, you will need php-fpm installed and running on the server as well. To see if you have that installed you can type the following:

    sudo systemctl status php-fpm
    

    If you get a message saying that it isn’t installed, you will need to install it and start and enable the service.

    You will also need to add the following code to your wp.domain.com conf file.

       server {
    
            listen 80;
            server_name wp.domain.com www.domain.com;
            root /path/to/subdomainfolder;
            index index.php index.html index.htm;
    
            access_log /var/log/nginx/wp.domain.com.access.log;
            error_log  /var/log/nginx/wp.domain.com.error.log;
    
            location / {
                    try_files $uri $uri/ /index.php?$args;
            }
    
            location ~ \.php$ {
                    try_files $uri $document_root$fastcgi_script_name =404;
                    include fastcgi.conf;
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    include fastcgi_params;
                    fastcgi_intercept_errors on;
                    fastcgi_pass unix:/path/to/php-fpm.sock; # This is usually /run/folder/path
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    fastcgi_cache WORDPRESS;
                    fastcgi_cache_valid 200 60m;
                    fastcgi_cache_bypass $skip_cache;
                    fastcgi_no_cache $skip_cache;
            }
    
    
            location = /favicon.ico {
                    log_not_found off;
                    access_log off;
            }
    
            location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|>                expires max;
                    log_not_found off;
                    access_log off;
            }
    
            set $skip_cache 0;
    
            if ($request_method = POST) {
                    set $skip_cache 1;
            }
    
            if ($query_string != "") {
                    set $skip_cache 1;
            }
    
            if ($request_uri ~* "/wp-admin/|/wp-login.php") {
                    set $skip_cache 1;
            }
    
    }
    
    

    The above is what I have for one of the wordpress sites I manage.

    @Hari said in configure ghost and wordpress combo:

    I gave up on that setup and tried installing WordPress on another droplet with a LEMP stack, but I ran into an issue with the upload file size limit. I might chose to Hostinger for hosting WordPress instead.

    The upload size limit is kept in your php.ini file. It is under max_upload_size or something like that. You will also want to change your post_max_size and one other one that is similiar to that, that I can’t remember the name of. You could put in like 200 M or less or more if you wanted. That will be like that no matter what stack you are using or which hosting service you are using. Even if you are using Virtualmin you will need to make that change in the php.ini for that website.

    I hope this helps you out. You can always give us a description of your site and post your config files along with you Nginx conf files for your sites and we can see and hone in on what may be happening and why it isn’t routing like it should.

  • wrote on last edited by
    #6

    Another thing I thought of, is make sure to install all of the php extension for Nginx. Below is a link to the php extensions you will want to install as well. You will want the highly recommended and I usually will install the suggested as well.

    https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions

    Also remember if you make changes to restart php-fpm service and nginx service.

  • Another thing I thought of, is make sure to install all of the php extension for Nginx. Below is a link to the php extensions you will want to install as well. You will want the highly recommended and I usually will install the suggested as well.

    https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions

    Also remember if you make changes to restart php-fpm service and nginx service.

    wrote on last edited by phenomlab
    #7

    @Madchatthew even if @Hari has abandoned his attempts, this additional information you’ve provided is very useful for someone else who may find themselves in a similar situation.

    Thanks

  • @Madchatthew even if @Hari has abandoned his attempts, this additional information you’ve provided is very useful for someone else who may find themselves in a similar situation.

    Thanks

    wrote on last edited by
    #8

    @phenomlab You are welcome. I had thought if I should post or not in regards to his reply but thought just in case if he tries it again. But I am stubborn and will keep trying until I force it to work haha. If anyone has the same issue, hopefully this will help.

  • @phenomlab You are welcome. I had thought if I should post or not in regards to his reply but thought just in case if he tries it again. But I am stubborn and will keep trying until I force it to work haha. If anyone has the same issue, hopefully this will help.

    wrote on last edited by
    #9

    @Madchatthew I’d always post for the reasons I stated above. It’s useful information and could save someone else the headache.


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee ☕
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics
  • 3 Votes
    6 Posts
    4k Views
    phenomlab
    @DownPW said in Nginx core developer quits project in security dispute, starts “freenginx” fork: Maybe virtualmin implement it in the future… I don’t think they will - my guess is that they will stick with the current branch of NGINX. I’ve not personally tested it, but the GIT page seems to be very active. This is equally impressive [image: 8ac0d197-68fa-4bd8-bfa3-87237bf8f1f4-image.png] I think the most impressive on here is the native support of HTTP 3
  • NODEBB: Nginx error performance & High CPU

    Solved Performance performance nodebb nginx
    69
    4
    14 Votes
    69 Posts
    63k Views
    DownPW
    @phenomlab Seems to be better with some scaling fix for redis on redis.conf. I haven’t seen the message yet since the changes I made # I increase it to the value of /proc/sys/net/core/somaxconn tcp-backlog 4096 # I'm uncommenting because it can slow down Redis. Uncommented by default !!!!!!!!!!!!!!!!!!! #save 900 1 #save 300 10 #save 60 10000 If you have other Redis optimizations. I take all your advice https://severalnines.com/blog/performance-tuning-redis/
  • Flarum - WordPress Journey

    WordPress flarum wordpress quitting
    59
    22 Votes
    59 Posts
    22k Views
    phenomlab
    @Sala I will likely need admin access to your site for this.
  • WordPress and NodeBB on different machines

    Solved WordPress
    10
    2 Votes
    10 Posts
    4k Views
    cagatay
    @phenomlab thank you for information.
  • Cannot read property 'config' of undefined

    Solved Configure
    1
    0 Votes
    1 Posts
    945 Views
    No one has replied
  • WordPress installation

    WordPress wordpress
    6
    0 Votes
    6 Posts
    2k Views
    JAC
    @phenomlab said in WordPress installation: @jac that plugin is for single sign on between WordPress and NodeBB. The plugin you really need is this Brilliant, that does look good!
  • Anyone using Ghost ?

    Customisation ghost cms
    47
    12 Votes
    47 Posts
    19k Views
    JAC
    @phenomlab I’m really looking forward to trying out ghost fairly soon. Should I underestimate the fact I’m not a writer? .
  • Virtualmin Letsencrypt Renewal

    Solved Hosting
    13
    1 Votes
    13 Posts
    6k Views
    phenomlab
    @gotwf said in Virtualmin Letsencrypt Renewal: I favor KISS engineering Then I think you’ll be able to appreciate this https://content.sudonix.com/keep-it-simple-stupid/