Php ��� oracle linux

Php ��� oracle linux

This tutorial provides instructions for installing the Apache web server and enabling it on Oracle Linux 8.

Background

Apache has been in active development since 1993 and over time has become one of the most popular web servers in the world. The Apache web server is a key component of the «LAMP» (Linux, Apache, Oracle MySQL and Perl/PHP) software stack and continues to be widely used today.

The Apache web server is directly available from the Oracle Linux 8 Application Streams repository and is simple to deploy and configure.

What Do You Need?

  • Any system with Oracle Linux 8 installed

Install the httpd package

The following command installs the httpd package and all of its dependencies.

Enable and start the httpd service

To enable and start the httpd service for immediate access and make the service start automatically after a reboot, run the following command:

The service starts a web server that listens on TCP port 80 by default. To check the status of the service, run this command:

Configure firewall rules (Optional)

If you are using a custom firewall profile or an Oracle Cloud Infrastructure instance, open the firewall port for the Apache web service (80).

These commands enable the firewall port for the Apache web service and reload the default firewall service:

Test your deployment

With your web browser, go to the domain name or IP address of your system.

The Apache web server opens the default test page.

Edit the Apache configuration

To change the root path for your web server, do not edit the /etc/httpd/conf/httpd.conf directly. Instead, as a preferred method, create a site-specific configuration in the /etc/httpd/conf.d directory.

Create virtual hosts

Create the file /etc/httpd/conf.d/example.com.conf and populate it with the following content:

Replace the ServerName and ServerAlias values with the hostnames, domain names, or IP addresses that you will use to access the service. Replace the DocumentRoot value with the path to where you intend to host the files for your web site. Replace the ErrorLog and CustomLog values with the path to where you intend to log activity from the httpd service.

Create the document root folder

Create a folder to host the web pages that Apache will serve to the browsers, then set the necessary ownership permissions for it.

On systems where SELinux is enabled in enforcing mode and pages are not served from within the /var/www directory, you must apply the correct security context to the DocumentRoot directory. For example, you would serve web pages from the /mnt/example.com directory as follows:

Apply your configuration

Restart the Apache web service to load the new configuration.

Note that if you are hosting multiple domains, you can specify different VirtualHost values for each configuration file that you create in the /etc/httpd/conf.d directory.

Configure HTTPS to secure your service

As a best practice, secure all communications between a web browser and your Apache server by using HTTPS. For a secure setup, a TLS certificate is required.

Configure your TLS/SSL certificates

Oracle strongly recommends using an TLS certificate that has been signed by an external Certificate Authority (CA). See https://docs.oracle.com/en/operating-systems/oracle-linux/certmanage/ for more information.

Install the HTTPS add-on for Apache

Install and enable the mod_ssl extension for Apache.

Update the Apache configuration

Open the /etc/httpd/conf.d/example.com.conf file in a text editor and create a new VirtualHost for HTTPS:

Redirect HTTP requests to HTTPS

Replace your existing HTTP VirtualHost configuration with a redirect, as follows:

Restart the Apache service to load the new configuration.

Configure the firewall (optional)

Enable the firewall port (443) for the Apache HTTPS web service and reload the default firewall service.

Next Tutorial

Want to Learn More?

  • httpd(8) manual page.
  • Upstream documentation at https://httpd.apache.org/docs/
  • Oracle Linux Documentation

Oracle Linux: Install the Apache Web Server

Copyright © 2020, Oracle and/or its affiliates.

This tutorial provides instructions to install the Apache web server and enable it in Oracle Linux 8.

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

Читайте также:  Цветовой профиль apple rgb для windows

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are «commercial computer software» or «commercial computer software documentation» pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract. The terms governing the U.S. Government’s use of Oracle cloud services are defined by the applicable contract for such services. No other rights are granted to the U.S. Government.

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.

Источник

Install Apache and PHP on an Oracle Linux Instance

Introduction

In this tutorial, you use an Oracle Cloud Infrastructure Free Tier account to set up an Oracle Linux instance. Then, you install an Apache web server and PHP and access your new server from the internet.

This tutorial covers all the steps necessary to set up a virtual network for your host and connect the host to the internet. Key tasks include how to:

  • Install your Oracle Linux instance and connect it to your Virtual Cloud Network (VCN).
    • Set up an Oracle Cloud Infrastructure virtual cloud network and related network services required for your host to connect to the internet.
    • Set up ssh encryption keys to access your Oracle Linux Server.
  • Configure ingress rules for your VCN.
  • Configure Apache and PHP 7 on your instance.
  • Connect to your instance from the internet.

Here is a simplified diagram of the setup for your Linux instance.

For additional information, see:

Before You Begin

To successfully complete this tutorial, you must have the following:

Requirements

  • An Oracle Cloud Infrastructure Free Tier account. See Oracle Cloud Free Tier.
  • A MacOS, Linux, or Windows computer with ssh support installed.

Install your Oracle Linux Instance

Use the Create a VM Instance wizard to create a new compute instance.

The wizard does several things when installing the instance:

  • Creates and installs a compute instance running Oracle Linux.
  • Creates a VCN with the required subnet and components needed to connect your Oracle Linux instance to the internet.
  • Creates an ssh key pair you use to connect to your instance.
Читайте также:  Драйвера для amd radeon hd 5700 series для windows 10 64 bit

Review Installation Steps

To get started installing your instance with the Create a VM Instance wizard, follow these steps:

From the main landing page, select Create a VM Instance wizard.

The Create Compute Instance is displayed. It has a section for Configure placement and hardware, Configure networking, Add SSH keys, and Configure boot volume.

Choose the Name and Compartment.

Initial Options

  • Name:
  • Create in Compartment: Enter a value for the name or leave the system supplied default. For compartment, select the default root compartment.

Review the Configure placement and hardware settings. Take the default values provided by the wizard.

Note: The following is sample data. The actual values change over time or differ in a different data center.

Placement

    Availability Domain: AD-1

Fault Domain: Oracle chooses the best placement. Image

Image build: 2020.11.10-1 Shape

  • Shape: VM.Standard.E2.1.Micro
  • OCPU Count: 1
  • Memory (GB): 1
  • Network Bandwidth (Gbps): 0.48
  • Note: For Free Tier, use Always Free Eligible options for availability domain and shape.

    Review the Configure networking settings. Take the default values provided by the wizard.

    Note: The following is sample data. The actual values change over time or differ in a different data center.

    • Virtual Cloud Network: vcn- —
    • Subnet: vcn- —
    • Use network security groups to control traffic: No
    • Assign a public IPv4 address: Yes

    If you want to change the values, click the Edit in the upper right of the dialog.

    Review the Add SSH keys settings. Take the default values provided by the wizard.

    • Select the Generate SSH Key Pair.
    • Click the Save Private Key and Save Public Key to save the private and public SSH keys for this compute instance.

    If you want to use your own SSH keys, select one of the options to provide your public key.

    Note: Put your private and public key files in a safe location. You cannot retrieve keys again after the compute instance has been created.

    Review the Configure boot volume settings. Take the default values provided by the wizard.

    Leave all check boxes unchecked.

    Click Create to create the instance. Provisioning the system might take several minutes.

    You have successfully created an Oracle Linux instance to run your Apache Web Server.

    Enable Internet Access

    The Create a VM Instance wizard automatically creates a VCN for your VM. You add an ingress rule to your subnet to allow internet connections on port 80.

    Create an Ingress Rule for your VCN

    Follow these steps to select your VCN’s public subnet and add the ingress rule.

    From the main menu, select Networking then select Virtual Cloud Networks.

    Select the VCN you created with your compute instance.

    With your new VCN displayed, click your subnet-xxxx subnet link.

    The public subnet information is displayed with the Security Lists at the bottom of the page. A link to the Default Security List for your VCN is displayed.

    Click the Default Security List link.

    The default Ingress Rules for your VCN are displayed.

    Click Add Ingress Rules.

    An Add Ingress Rules dialog is displayed.

    Fill in the ingress rule with the following information.

    Fill in the ingress rule as follows:

    • Stateless: Checked
    • Source Type: CIDR
    • Source CIDR: 0.0.0.0/0
    • IP Protocol: TCP
    • Source port range: (leave-blank)
    • Destination Port Range: 80
    • Description: Allow HTTP connections

    Click Add Ingress Rule. Now HTTP connections are allowed. Your VCN is configured for Apache server.

    You have successfully created a VCN that makes your instance available from the internet.

    Install and Configure Apache and PHP

    With your compute instance and VCN setup, install, and configure Apache web server and PHP to run on your Oracle Linux instance.

    Install and Configure Apache

    With your compute instance and VCN setup, install, and configure Apache web server on your Oracle Linux instance.

    Follow these steps to configure your Oracle Linux instance.

    From the main menu, select Compute then Instances.

    Click the link to the instance you created in the previous step.

    From the Instance Details page look under the Instance Access section. Write down the Public IP Address the system created for you. You use this IP address to connect to your instance.

    Open a Terminal or Command Prompt window.

    Change into the directory where you stored the ssh encryption keys you created in part 1.

    Connect to your instance with this SSH command.

    Since you identified your public key when you created the instance, this command logs you into your instance. You can now issue sudo commands to install and start your server.

    Install Apache Server.

    The command returns:

    Enable HTTP connection through port 80.

    The commands returns:

    Читайте также:  Transmission для windows server

    Reload the firewall.

    You can now test your server.

    You can test your server from the command line with curl localhost . Or, you can connect your browser to the public IP address assigned to your instance: http:// .

    Note: Get the IP address from your compute instance details page. From the main menu, select Compute then Instances. Select the compute instance your created. The IP address is listed under the Public IP Address field.

    Congratulations! You have successfully installed Apache on your Oracle Cloud Infrastructure instance.

    Install and Configure PHP

    Install and configure PHP to run on your Oracle Linux instance.

    Configure the Oracle Linux package repos to use PHP 7.

    After the command is run, yum installs PHP 7 by default rather than PHP 5.

    The command installs php , php-cli , and php-common .

    The command returns text similar to the following:

    Add a PHP test file to your instance.

    Create the file:

    In the file, input the following text and save the file:

    Connect to http:// /info.php.

    The browser produces a listing of PHP configuration on your instance.

    Note: After you are done testing, remove info.php from your system.

    Congratulations! You have successfully installed Apache and PHP 7 on your Oracle Cloud Infrastructure instance.

    What’s Next

    You have successfully installed and deployed an Apache web server on Oracle Cloud Infrastructure using a Linux instance.

    To explore more information about development with Oracle products:

    Learn More

    Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

    For product documentation, visit Oracle Help Center.

    Install Apache and PHP on an Oracle Linux Instance

    Copyright © 2021, Oracle and/or its affiliates.

    This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

    The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

    If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

    U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are «commercial computer software» pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

    This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

    Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

    Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

    This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.

    Источник

    Оцените статью