Editing
Installation Guide
From Vichan Wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
This page covers how to install vichan. == Base Requirements == # PHP >= 7.4 # MySQL/MariaDB server # [http://www.php.net/manual/en/mbstring.installation.php mbstring] # [http://www.php.net/manual/en/intro.image.php PHP GD] # [http://www.php.net/manual/en/intro.pdo.php PHP PDO] # [http://www.php.net/manual/en/intro.bc.php PHP BCMath] # [https://getcomposer.org/doc/00-intro.md Composer] # A [[wikipedia:Unix-like|Unix-like]] OS We try to make sure vichan is compatible with all major web servers. vichan does not include an Apache `.htaccess` file nor does it need one. === Recommended === # MySQL/MariaDB server >= 5.5.3 # ImageMagick (command-line ImageMagick or GraphicsMagick preferred). # [http://php.net/manual/en/book.apcu.php APCu (Alternative PHP Cache)], [http://www.php.net/manual/en/intro.memcached.php Memcached] or [https://redis.io/docs/about/ Redis] # Gifsicle If you have '''zero''' experience running a website, [https://landchad.net landchad.net] has a nice guide on how to set up a web server. [https://ubuntu.com/ Ubuntu] is by far the easiest OS to use to set up any server, providing bleeding edge updates. However, if you seek assurance against 0-day exploits, a stable distro such as [https://www.debian.org/ Debian] or [https://www.alpinelinux.org/ Alpine] is preferred. Although they are slower to update their repositories, they are much less likely to be impacted by security vulnerabilities. == Downloading Vichan == It is recommended that you utilize <code>git clone</code> to install vichan. This will install the latest version of the software. Make sure you have navigated in your terminal to whichever directory your webserver is in (commonly /var/www/), or <code>cd /var/www/</code>. Then clone the repository by entering <code>git clone https://github.com/vichan-devel/vichan.git FolderName</code> (with FolderName being optional). You may need to install git first. After this finishes, if you did not specify a destination folder you may opt to move the resulting folder (named vichan) to something else (<code>mv vichan NewFolderName</code>). Next, enter your vichan folder (<code>cd vichan</code>) and run composer (<code>composer install</code>). : If you do not have all needed dependencies installed, composer may fail, in which case it will tell you what is needed. == Configuring the Web server == Vichan does not require much of a modified configuration to work. If you are on the fence on which server to use, Nginx is more commonly used and is notably faster on larger websites. Apache, on the other hand, works more "out of the box" and may be easier to understand if less experienced with running a server. Both servers work well with vichan. If you're using constrained hardware, Lighttpd is a third software that is tailored towards light resource usage. ===Apache=== After installing apache, a simple config like this will work well. This should be located within your /etc/apache2/sites-available directory (this is in /etc/httpd/sites-available for centos or fedora): <pre> <VirtualHost *:80> ServerName example.com ServerAlias www.example.com # Optional <Directory /var/www/YourVichanFolder> Options -Indexes +FollowSymLinks AllowOverride All Require all granted </Directory> ServerAdmin webmaster@localhost DocumentRoot /var/www/YourVichanFolder ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined ErrorDocument 403 /static/403.html ErrorDocument 404 /static/404.html </VirtualHost> </pre> The following site config disables directory listing. Then utilize <code>a2ensite yoursiteconfig</code> and reload apache to start your website. ===Nginx=== A nginx config similar to the following will work for vichan. Make sure that php-fpm is installed (<code>apt-get install php-fpm</code> or <code>dnf install php-fpm</code>). <pre> server { server_name example.com www.example.com; root /var/www/YourVichanFolder; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.3-fpm.sock; # Replace with the version of php you are running. } error_page 403 /static/403.html; error_page 404 /static/404.html; } </pre> You may also want to edit either the above config or nginx.conf (within the server or http block respectively) to add the following line, which will allow files larger than 1mb. <code>client_max_body_size 100M; #100 megabytes</code> === Lighttpd === <syntaxhighlight> server.modules += ("mod_fastcgi") static-file.exclude-extensions = (".php", ".pl", ".cgi", ".fcgi") # If using a TCP port: fastcgi.server = ( ".php" => ( "localhost" => ( "host" => "127.0.0.1", "port" => "9000" ) ) ) # If using a Unix socket: fastcgi.server = ( ".php" => ( "localhost" => ( "socket" => "/run/lighttpd/lighttpd-fastcgi-php-" + PID + ".socket", "bin-path" => "/usr/bin/php-cgi" ) ) ) server.document-root = var.basedir + "/path/to/vichan" index-file.names = ("index.php", "index.html", "index.htm", "default.htm") </syntaxhighlight> == Cloudflare == == MySQL == Vichan will not create a database for you, so you will have to do it yourself. You can use [https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql this guide] if you do not know how creating users in MySQL/MariaDB works. Or [https://www.digitalocean.com/community/tutorials/how-to-create-and-manage-databases-in-mysql-and-mariadb-on-a-cloud-server this guide] for databases. All that is needed is to create a user (or use an existing user), create the database, then give that user all permissions for said database. == File Permissions == The following files and folders either need to be given to '''www-data''' or given 777 permissions: * the root vichan directory (non-recursively) * inc/secrets.php * templates/cache (recursively) * tmp/cache (recursively) == Install.php == After all above steps are followed, then install.php will begin to function. If it shows a white screen, make sure you ran composer. If you already ran it, check your php-fpm or apache logs to see what is going on. Install.php will first show the following screen. Make sure to read and accept the agreement. <gallery> File:Vichanagreement.png File:Vichaninstall2.png|After accepting the TOS, this screen appears. The file permissions were not yet set in this pictured screenshot. </gallery>
Summary:
Please note that all contributions to Vichan Wiki are considered to be released under the Creative Commons Attribution (see
Vichan Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
Edit source
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Tools
What links here
Related changes
Special pages
Page information