One place for hosting & domains

      Manually

      How to Manually Install WordPress


      In this post, we’re going to show you how to manually install WordPress and configure it. We’ll tell you what tools you’ll need and walk you through the installation process step by step. Let’s dive in.

      WordPress is the most popular web platform and Content Management System (CMS) worldwide. By choosing it to develop your site, you’re joining a thriving community of users and developers. However, if you’ve never installed WordPress before, you may be unsure of the process and how to get everything working.

      Fortunately, all you need is a clear plan and a bit of patience. Performing a manual installation will likely take more time than the one-click method. However, by the time you’re done, you’ll have a stronger understanding of what makes the platform so amazing, as well as valuable knowledge that you can use in the future.

      How DreamHost Simplifies Installing WordPress

      Manually installing WordPress isn’t too difficult, but it can trip you up if you come across an unfamiliar aspect of the platform. We’ll discuss why and how to perform this kind of installation in a moment, but we would be remiss if we didn’t first tell you how you can avoid it altogether.

      Instead of installing WordPress on your own, you can often perform this task through your hosting service. If that service is optimized for WordPress, you may be offered features that dramatically simplify the process.

      For a perfect example, check out our managed WordPress hosting plan. When you opt for this or one of our other WordPress-specific hosting options, you’ll get access to a one-click method for installing the platform. This lets you set up a new site in minutes without any technical know-how.

      However, if you don’t have access to a one-click installation option, or you simply want to know how to install WordPress manually, read on to learn about everything that’s involved.

      When Should You Manually Install WordPress

      As we’ve discussed, a hosting plan such as DreamPress offers you a simple way to install WordPress. However, there are also reasons you may want to perform a manual installation.

      For starters, a manual install gives you an opportunity to learn the ins and outs of how the platform works under the hood. This gives you extra insight when it comes to troubleshooting and dealing with any issues that may arise, along with a way to become more confident with WordPress and its customization.

      You’ll also be able to parlay that knowledge into creating a local installation using a tool such as XAMPP. This is a great way to test your site before you display it to the public.

      The Tools You’ll Need to Manually Install WordPress

      Before diving into the process, there are a few tools you’ll need to install WordPress manually. In addition to a hosting provider that enables you to create databases and users, you’ll also need:

      • A File Transfer Protocol (FTP) client. We recommend FileZilla, as it is open-source, platform-independent, easy to use, and supports secure transfer protocols. You may also need to brush up on your FTP skills before you get started.
      • The latest version of WordPress. You’ll want to download this by clicking the blue button on the WordPress.org website.
      • A dedicated coding text editor. This is optional, given that every Operating System (OS) includes a standard solution.

      On this last point, while you’ll likely be able to edit text files directly via your hosting account panel, we recommend using FTP.

      As we mentioned, while you can edit files using any text editor, a solution such as Atom can offer you more flexibility and other features to help make life easier down the line.

      How to Manually Install WordPress (In 5 Steps)

      With your tools in place, you’re ready to start manually installing WordPress, beginning with setting up a database and admin user.

      Step 1: Create a New WordPress Database and User

      Full disclosure here: This can sometimes be the most confusing step, as it involves a lot of detail. Not only are we going to create a database and an associated user account, but we’ll also refer back to them later when configuring your wp-config.php file.

      Your first step is to log in to your hosting account, access your account dashboard, and find an option that enables you to create databases. In DreamHost, navigate to Websites > MySQL Databases.

      Under the Create a new MySQL database section, fill out each field accordingly. When creating a new user, it’s important to choose a strong, hard-to-guess password — we recommend using a dedicated password generator. Note your credentials for later use, and click Add new database now!

      Creating a new MySQL database with Dreamhost

      Finally, you’ll need to set up privileges for your user account. Since you’re the administrator, you’ll need complete access. To do this, go to the MySQL Databases screen, find your database at the top, and click the user you just created under the Users Access column:

      User access to databases in Dreamhost

      Here, simply tick all of the boxes under the What may users do to tables in these databases? section, and save your changes. Your database should now be ready to use! The next step is to access it via WordPress.

      Step 2: Configure WordPress’ wp-config.php File

      In this step, we need to tell WordPress where your database is and how to access it using the wp-config.php file. In a nutshell, this file tells WordPress where to find every element of your site in the database. As you can imagine, it’s a key WordPress core file.

      To get started, navigate to your downloaded WordPress folder, and unzip it. Inside, you’ll find the wp-config-sample.php file. You’ll need to open it and find the following code:

      // ** MySQL settings - You can get this info from your web host ** //
      
      /** The name of the database for WordPress */
      define('DB_NAME', 'database_name_here');
      /** MySQL database username */
      define('DB_USER', 'username_here');
      /** MySQL database password */
      define('DB_PASSWORD', 'password_here');
      /** MySQL hostname */
      define('DB_HOST', 'mysql.example.com');

      You’ll need to replace the placeholders in each relevant define function with the database information from the previous step, specifically:

      • database_name_here (including the prefix and underscore outlined in the last step).
      • username_here (again, including the prefix and underscore).
      • password_here.
      • mysql.example.com (you’ll need to create a MySQL hostname in your panel and use that as the DB_HOST hostname).

      Finally, save your changes, then rename the file itself to wp-config.php. It’s now time to upload WordPress to your server.

      Get Content Delivered Straight to Your Inbox

      Subscribe to our blog and receive great content just like this delivered straight to your inbox.

      Step 3: Upload Your WordPress Files to Your Server

      This step is arguably the easiest to achieve. We’ve actually already discussed how to find your FTP credentials and log in to your server. Once you’re there, you’re looking for the top-level directory (this could be called home, public_html, www, or root).

      You could install WordPress into a subdirectory (particularly if you’ve already got a website up and running). However, for this example, we’re using a clean server. To do this, simply navigate to your local WordPress folder in the left-hand panel of FileZilla, copy all of the files within, and drag them to your root folder:

      Now that your files are uploaded and your database is set up, the penultimate step is to install and set up WordPress itself.

      Step 4: Run WordPress’ Installation Script

      Once the previous steps are completed, it’s time to run the script that will complete your WordPress installation. To begin, navigate to yourdomain.com/wp-admin/install.php, replacing the placeholder domain with that of your site.

      You should see a prompt asking you to choose a language for your WordPress installation, which you should do before clicking Continue:

      select WordPress language

      The next screen enables you to name your site and add a WordPress admin username, password, and email address. When creating your username, it’s important to make sure it’s secure. If nothing else, choose a different name than simply admin — and also generate a complex password.

      create a wordpress username and password

      Finally, uncheck the Allow search engines to index this site box. This stops your site from appearing in search engines until you’re ready to go live, although you can change this setting later within WordPress. When you’re finished, click Install WordPress.

      Step 5: Finalize and Test Your Installation

      Once WordPress is installed, you’ll be brought to the WordPress dashboard. If not, you’ll want to work through some of the common installation problems and consult your host if you run into difficulty.

      At this point, you’ll likely be wondering what to do next. Here’s what we recommend:

      • Choose a suitable theme. In short, this governs how your site looks on the ‘front end’.
      • Install some essential plugins. These add-ons extend WordPress’ functionality, and some are crucial for protecting your site and users.
      • Get writing. You’ll now want to create any pages and posts you’ll need — this is the fun part!

      Our advice is to immerse yourself within WordPress by reading as much content about the platform as possible. Our blog is a great place to start, but there is a wealth of available information on WordPress and its workings. For example, the Codex will be key in developing your expertise.

      Install WordPress Easily

      Understanding how to manually install WordPress gives you an advantage when building a successful site. You can see exactly how your website interacts with the database, as well as how your files and their permissions work. You can also learn to troubleshoot issues at the source while gaining a skill set that will enable you to confidently build future sites.

      Do More with DreamPress

      DreamPress Plus and Pro users get access to Jetpack Professional (and 200+ premium themes) at no added cost!

      Managed WordPress Hosting - DreamPress



      Source link

      How to Manually Set Up a Prisma Server on Ubuntu 18.04


      The author selected the Electronic Frontier Foundation to receive a donation as part of the Write for DOnations program.

      Introduction

      Prisma is a data layer that replaces traditional object-relational mapping tools (ORMs) in your application. Offering support for both building GraphQL servers as well as REST APIs, Prisma simplifies database access with a focus on type safety and enables declarative database migrations. Type safety helps reduce potential code errors and inconsistencies, while the declarative database migrations allow you to store your datamodel in version control. These features help developers reduce time spent focused on setting up database access, migrations, and data management workflows.

      You can deploy the Prisma server, which acts as a proxy for your database, in a number of ways and host it either remotely or locally. Through the Prisma service you can access your data and connect to your database with the GraphQL API, which allows realtime operations and the ability to create, update, and delete data. GraphQL is a query language for APIs that allows users to send queries to access the exact data they require from their server. The Prisma server is a standalone component that sits on top of your database.

      In this tutorial you will manually install a Prisma server on Ubuntu 18.04 and run a test GraphQL query in the GraphQL Playground. You will host your Prisma setup code and development locally — where you will actually build your application — while running Prisma on your remote server. By running through the installation manually, you will have a deeper understanding and customizability of the underlying infrastructure of your setup.

      While this tutorial covers the manual steps for deploying Prisma on an Ubuntu 18.04 server, you can also accomplish this in a more automated way with Docker Machine by following this tutorial on Prisma’s site.

      Note: The setup described in this section does not include features you would normally expect from production-ready servers, such as automated backups and active failover.

      Prerequisites

      To complete this tutorial, you will need:

      Step 1 — Starting the Prisma Server

      The Prisma CLI is the primary tool used to deploy and manage your Prisma services. To start the services, you need to set up the required infrastructure, which includes the Prisma server and a database for it to connect to.

      Docker Compose allows you to manage and run multi-container applications. You’ll use it to set up the infrastructure required for the Prisma service.

      You will begin by creating the docker-compose.yml file to store the Prisma service configuration on your server. You’ll use this file to automatically spin up Prisma, an associated database, and configure the necessary details, all in one step. Once the file is spun up with Docker Compose, it will configure the passwords for your databases, so be sure to replace the passwords for managementAPIsecret and MYSQL_ROOT_PASSWORD with something secure. Run the following command to create and edit the docker-compose.yml file:

      • sudo nano docker-compose.yml

      Add the following content to the file to define the services and volumes for the Prisma setup:

      docker-compose.yml

      version: "3"
      services:
        prisma:
          image: prismagraphql/prisma:1.20
          restart: always
          ports:
            - "4466:4466"
          environment:
            PRISMA_CONFIG: |
              port: 4466
              managementApiSecret: my-secret
              databases:
                default:
                  connector: mysql
                  host: mysql
                  port: 3306
                  user: root
                  password: prisma
                  migrations: true
        mysql:
          image: mysql:5.7
          restart: always
          environment:
            MYSQL_ROOT_PASSWORD: prisma
          volumes:
            - mysql:/var/lib/mysql
      volumes:
        mysql:
      

      This configuration does the following:

      • It launches two services: prisma-db and db.
      • It pulls in the latest version of Prisma. As of this writing, that is Prisma 1.20.
      • It sets the ports Prisma will be available on and specifies all of the credentials to connect to the MySQL database in the databases section.

      The docker-compose.yml file sets up the managementApiSecret, which prevents others from accessing your data with knowledge of your endpoint. If you are using this tutorial for anything but a test deployment, you should change the managementAPIsecret to something more secure. When you do, be sure to remember it so that you can enter it later during the prisma init process.

      This file also pulls in the MySQL Docker image and sets those credentials as well. For the purposes of this tutorial, this Docker Compose file spins up a MySQL image, but you can also use PostgreSQL with Prisma. Both Docker images are available on Docker hub:

      Save and exit the file.

      Now that you have saved all of the details, you can start the Docker containers. The -d command tells the containers to run in detached mode, meaning they’ll run in the background:

      • sudo docker-compose up -d

      This will fetch the Docker images for both prisma and mysql. You can verify that the Docker containers are running with the following command:

      You will see an output that looks similar to this:

      CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                    NAMES
      24f4dd6222b1        prismagraphql/prisma:1.12   "/bin/sh -c /app/sta…"   15 seconds ago      Up 1 second         0.0.0.0:4466->4466/tcp   root_prisma_1
      d8cc3a393a9f        mysql:5.7                   "docker-entrypoint.s…"   15 seconds ago      Up 13 seconds       3306/tcp                 root_mysql_1
      

      With your Prisma server and database set up, you are now ready to work locally to deploy the Prisma service.

      Step 2 — Installing Prisma Locally

      The Prisma server provides the runtime environments for your Prisma services. Now that you have your Prisma server started, you can deploy your Prisma service. You will run these steps locally, not on your server.

      To start, create a separate folder to contain all of the Prisma files:

      Then move into that folder:

      You can install Prisma with Homebrew if you're using MacOS. To do this, run the following command to add the Prisma repository:

      You can then install Prisma with the following command:

      Or alternately, with npm:

      With Prisma installed locally, you are ready to bootstrap the new Prisma service.

      Step 3 — Creating the Configuration for a New Prisma Service

      After the installation, you can use prisma init to create the file structure for a new Prisma database API, which generates the files necessary to build your application with Prisma. Your endpoint will automatically be in the prisma.yml file, and datamodel.prisma will already contain a sample datamodel that you can query in the next step. The datamodel serves as the basis for your Prisma API and specifies the model for your application. At this point, you are only creating the files and the sample datamodel. You are not making any changes to the database until you run prisma deploy later in this step.

      Now you can run the following command locally to create the new file structure:

      After you run this command you will see an interactive prompt. When asked, select, Use other server and press ENTER:

      Output

      Set up a new Prisma server or deploy to an existing server? You can set up Prisma for local development (based on docker-compose) Use existing database Connect to existing database Create new database Set up a local database using Docker Or deploy to an existing Prisma server: Demo server Hosted demo environment incl. database (requires login) ❯ Use other server Manually provide endpoint of a running Prisma server

      You will then provide the endpoint of your server that is acting as the Prisma server. It will look something like: http://SERVER_IP_ADDRESS:4466. It is key that the endpoint begins with http (or https) and has the port number indicated.

      Output

      Enter the endpoint of your Prisma server http://SERVER_IP_ADDRESS:4466

      For the management API secret, enter in the phrase or password that you indicated earlier in the configuration file:

      Output

      Enter the management API secret my-secret

      For the subsequent options, you can choose the default variables by pressing ENTER for the service name and service stage:

      Output

      Choose a name for your service hello-world Choose a name for your stage dev

      You will also be given a choice on a programming language for the Prisma client. In this case, you can choose your preferred language. You can read more about the client here.

      Output

      Select the programming language for the generated Prisma client (Use arrow keys) ❯ Prisma TypeScript Client Prisma Flow Client Prisma JavaScript Client Prisma Go Client Don't generate

      Once you have completed the prompt, you will see the following output that confirms the selections you made:

      Output

      Created 3 new files: prisma.yml Prisma service definition datamodel.prisma GraphQL SDL-based datamodel (foundation for database) .env Env file including PRISMA_API_MANAGEMENT_SECRET Next steps: 1. Open folder: cd hello-world 2. Deploy your Prisma service: prisma deploy 3. Read more about deploying services: http://bit.ly/prisma-deploy-services

      Move into the hello-world directory:

      Sync these changes to your server with prisma deploy. This sends the information to the Prisma server from your local machine and creates the Prisma service on the Prisma server:

      Note: Running prisma deploy again will update your Prisma service.

      Your output will look something like:

      Output

      Creating stage dev for service hello-world ✔ Deploying service `hello-world` to stage 'dev' to server 'default' 468ms Changes: User (Type) + Created type `User` + Created field `id` of type `GraphQLID!` + Created field `name` of type `String!` + Created field `updatedAt` of type `DateTime!` + Created field `createdAt` of type `DateTime!` Applying changes 716ms Your Prisma GraphQL database endpoint is live: HTTP: http://SERVER_IP_ADDRESS:4466/hello-world/dev WS: ws://SERVER_IP_ADDRESS:4466/hello-world/dev

      The output shows that Prisma has updated your database according to your datamodel (created in the prisma init step) with a type User. Types are an essential part of a datamodel; they represent an item from your application, and each type contains multiple fields. For your datamodel the associated fields describing the user are: the user’s ID, name, time they were created, and time they were updated.

      If you run into issues at this stage and get a different output, double check that you entered all of the fields correctly during the interactive prompt. You can do so by reviewing the contents of the prisma.yml file.

      With your Prisma service running, you can connect to two different endpoints:

      • The management interface, available at http://SERVER_IP_ADDRESS:4466/management, where you can manage and deploy Prisma services.

      • The GraphQL API for your Prisma service, available at http://SERVER_IP_ADDRESS:4466/hello-world/dev.

      GraphQL API exploring _Your Project_

      You have successfully set up and deployed your Prisma server. You can now explore queries and mutations in GraphQL.

      Step 4 — Running an Example Query

      To explore another Prisma use case, you can experiment with the GraphQL playground tool, which is an open-source GraphQL integrated development environment (IDE) on your server. To access it, visit your endpoint in your browser from the previous step:

      http://SERVER_IP_ADDRESS:4466/hello-world/dev
      

      A mutation is a GraphQL term that describes a way to modify — create, update, or delete (CRUD) — data in the backend via GraphQL. You can send a mutation to create a new user and explore the functionality. To do this, run the following mutation in the left-hand side of the page:

      mutation {
        createUser(data: { name: "Alice" }) {
          id
          name
        }
      }
      

      Once you press the play button, you will see the results on the right-hand side of the page.
      GraphQL Playground Creating a New User

      Subsequently, if you want to look up a user by using the ID column in the database, you can run the following query:

      query {
        user(where: { id: "cjkar2d62000k0847xuh4g70o" }) {
          id
          name
        }
      }
      

      You now have a Prisma server and service up and running on your server, and you have run test queries in GraphQL's IDE.

      Conclusion

      You have a functioning Prisma setup on your server. You can see some additional Prisma use cases and next steps in the Getting Started Guide or explore Prisma's feature set in the Prisma Docs. Once you have completed all of the steps in this tutorial, you have a number of options to verify your connection to the database, one possibility is using the Prisma Client.



      Source link