OJS: Difference between revisions

From Server STB
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 39: Line 39:
2. buat folder <b>bin</b>
2. buat folder <b>bin</b>
   di dalam folder <b>bin</b>
   di dalam folder <b>bin</b>
  2.1 buat file Dockerfile
  2.1 buat file <b>Dockerfile</b>


   FROM php:8.3-apache-bullseye
   FROM php:8.3-apache-bullseye
   RUN apt-get -y update --fix-missing && \
   RUN apt-get -y update --fix-missing && \
     apt-get upgrade -y && \
     apt-get upgrade -y && \
     apt-get --no-install-recommends install -y apt-utils && \
     apt-get --no-install-recommends install -y apt-utils && \
     rm -rf /var/lib/apt/lists/*
     rm -rf /var/lib/apt/lists/*
   RUN rm /etc/apt/preferences.d/no-debian-php
   RUN rm /etc/apt/preferences.d/no-debian-php
   RUN apt-get update && apt-get install -y \
   RUN apt-get update && apt-get install -y \
                 libfreetype6-dev \
                 libfreetype6-dev \
Line 68: Line 65:
         && docker-php-ext-configure gd --with-freetype --with-jpeg \
         && docker-php-ext-configure gd --with-freetype --with-jpeg \
         && docker-php-ext-install -j$(nproc) gd
         && docker-php-ext-install -j$(nproc) gd
   # RUN /usr/local/bin/phpize
   # RUN /usr/local/bin/phpize
   ######################################[INSTALL EXTENSI PHP]####################################
   ######################################[INSTALL EXTENSI PHP]####################################
   # RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql
   # RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql
Line 83: Line 78:
   #------------------------------------[AKTIFKAN UNTUK DEVELOPMEN]-------------------------------
   #------------------------------------[AKTIFKAN UNTUK DEVELOPMEN]-------------------------------
   RUN    pecl install xdebug && docker-php-ext-enable xdebug
   RUN    pecl install xdebug && docker-php-ext-enable xdebug
   RUN apt-get update && apt-get install -y openssl
   RUN apt-get update && apt-get install -y openssl
   RUN mkdir /certs && chmod -R 755 /certs && chown -R www-data:www-data /certs
   RUN mkdir /certs && chmod -R 755 /certs && chown -R www-data:www-data /certs
   RUN cd /certs && openssl req -x509 -newkey rsa:2048 -nodes -out localhost.crt -keyout localhost.key -subj "/C=ID/ST=Indonesia/L=Jakarta/O=Pusdakom/CN=localhost"
   RUN cd /certs && openssl req -x509 -newkey rsa:2048 -nodes -out localhost.crt -keyout localhost.key -subj "/C=ID/ST=Indonesia/L=Jakarta/O=Pusdakom/CN=localhost"
   RUN rm -f /etc/apache2/sites-enabled/default-ssl.conf
   RUN rm -f /etc/apache2/sites-enabled/default-ssl.conf
   COPY localhost.conf /etc/apache2/sites-available/default-ssl.conf
   COPY localhost.conf /etc/apache2/sites-available/default-ssl.conf
Line 95: Line 88:
     service apache2 restart
     service apache2 restart
     # curl -v https://localhost  # Test the SSL connection
     # curl -v https://localhost  # Test the SSL connection
   EXPOSE 443/tcp
   EXPOSE 443/tcp
   EXPOSE 80/tcp
   EXPOSE 80/tcp


 
  2.2 buat file <b>localhost.conf</b>
  2.2 buat file localhost.conf


   <VirtualHost *:443>
   <VirtualHost *:443>
Line 112: Line 103:
   </VirtualHost>
   </VirtualHost>


  2.3 buat file php.ini
  2.3 buat file <b>php.ini</b>


   file_uploads = On
   file_uploads = On
Line 126: Line 117:


5. buat folder logs
5. buat folder logs
6. buat file <b>.env</b>
  # RUBAH NOMOR PORT
  NOMOR_PORT=1001
  FOLDER_HTML="html"
  FOLDER_UPLOAD="files"

Latest revision as of 07:16, 21 August 2024

Persiapan

 apt install apache2 libapache2-mod-php php php-cli php-common php-mbstring php-gd php-intl php-xml php-mysql php-zip php-curl php-tidy php-imagick php-bcmath mariadb-client

Download

ojs 3.3

 wget https://pkp.sfu.ca/ojs/download/ojs-3.3.0-16.tar.gz | tar xzvf ojs-3.3.0-16.tar.gz

ojs 3.4

 wget https://pkp.sfu.ca/ojs/download/ojs-3.4.0-5.tar.gz | tar xzvf ojs-3.4.0-5.tar.gz


Settings

 session_check_ip = Off
 https://malikmustofa.my.id/2024/05/28/mencegah-serangan-judi-online-di-webserver-ojs-3/

OJS 3.4

buat folder ojs

di dalam folder ojs buat buat file :

1. docker-compose.yaml

 version: "3"
 services:
 webserver:
   build:
     context: ./bin
 # container_name: "form-umsida"
   restart: "always"
   ports:
     - "${NOMOR_PORT}:443"
   volumes:
     - ./logs:/var/log/:rw
     - ./${FOLDER_HTML}:/var/www/html
     # - ./php.ini:/usr/local/etc/php/conf.d/php-umsida.ini
     - ./${FOLDER_UPLOAD}:/var/www/files

2. buat folder bin

 di dalam folder bin
2.1 buat file Dockerfile
 FROM php:8.3-apache-bullseye
 RUN apt-get -y update --fix-missing && \
   apt-get upgrade -y && \
   apt-get --no-install-recommends install -y apt-utils && \
   rm -rf /var/lib/apt/lists/*
 RUN rm /etc/apt/preferences.d/no-debian-php
 RUN apt-get update && apt-get install -y \
               libfreetype6-dev \
               libjpeg62-turbo-dev \
               libpng-dev \
               build-essential \
               libcurl4-openssl-dev \
               libssl-dev \
               libpq-dev \
               git \
               libonig-dev \
               # libbz2-dev \
               zlib1g-dev \
               libxml2-dev \
               zip \
               unzip \
               libzip-dev \
       && docker-php-ext-configure gd --with-freetype --with-jpeg \
       && docker-php-ext-install -j$(nproc) gd
 # RUN /usr/local/bin/phpize
 ######################################[INSTALL EXTENSI PHP]####################################
 # RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql
 # RUN   docker-php-ext-install pdo pdo_pgsql pgsql
 RUN     docker-php-ext-install mysqli pdo_mysql
 RUN     docker-php-ext-install curl
 RUN     docker-php-ext-install mbstring
 RUN     docker-php-ext-install bcmath
 RUN     docker-php-ext-install xml
 RUN     docker-php-ext-install zip
 RUN     docker-php-ext-install intl
 #------------------------------------[AKTIFKAN UNTUK DEVELOPMEN]-------------------------------
 RUN     pecl install xdebug && docker-php-ext-enable xdebug
 RUN apt-get update && apt-get install -y openssl
 RUN mkdir /certs && chmod -R 755 /certs && chown -R www-data:www-data /certs
 RUN cd /certs && openssl req -x509 -newkey rsa:2048 -nodes -out localhost.crt -keyout localhost.key -subj "/C=ID/ST=Indonesia/L=Jakarta/O=Pusdakom/CN=localhost"
 RUN rm -f /etc/apache2/sites-enabled/default-ssl.conf
 COPY localhost.conf /etc/apache2/sites-available/default-ssl.conf
 COPY php.ini /usr/local/etc/php/conf.d/php-umsida.ini
 RUN a2enmod ssl rewrite && \
   a2ensite default-ssl && \
   service apache2 restart
   # curl -v https://localhost  # Test the SSL connection
 EXPOSE 443/tcp
 EXPOSE 80/tcp
2.2 buat file localhost.conf
 <VirtualHost *:443>
   SSLEngine on
   SSLProtocol all -SSLv2
   SSLCertificateFile /certs/localhost.crt
   SSLCertificateKeyFile /certs/localhost.key
   DocumentRoot /var/www/html
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
 </VirtualHost>
2.3 buat file php.ini
 file_uploads = On
 memory_limit = 64M
 upload_max_filesize = 248M
 post_max_size = 512M
 max_execution_time = 600
 log_errors = on

3. buat folder files

4. buat folder html

5. buat folder logs

6. buat file .env

 # RUBAH NOMOR PORT
 NOMOR_PORT=1001
 FOLDER_HTML="html"
 FOLDER_UPLOAD="files"