> For the complete documentation index, see [llms.txt](https://docs.layraweb.com.tr/merhaba/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layraweb.com.tr/merhaba/hosting-solution/cyberpanel/500-internal-server-hatasi-cyberpanel.md).

# 500 Internal Server Hatası (Cyberpanel)

Herkese merhaba, birkaç gün önce yaşadığımız bir problem hakkında konuşmak istiyoruz. Eğer <https://ipadresi:8090> adresinde 500 hatası alıyorsanız, bunun birden fazla sebebi olabilir. Biz mümkün olduğunca araştırma yaptık ancak sonunda kendi çözümümüzü bulduk ve resmi forumlardaki çeşitli çabalardan sonra soruna çözüm bulduk.&#x20;

İlk adım, klasik internet çözümlerinden biriydi,

#### Cyberpanel Debug

Cyberpanel üzerinde debug açmak için aşağıdaki işlemleri yapabiliriz;

```
nano /usr/local/CyberCP/CyberCP/settings.py
```

<figure><img src="https://blog.veriloji.com/wp-content/uploads/2020/02/cyberpanel_debug.png" alt="" height="345" width="668"><figcaption></figcaption></figure>

DEBUG = False yazan True değerini vererek dosyayı ctrl+x ile kaydedip çıkın ve lscpd servisini yeniden başlatın;

```
systemctl restart lscpd
```

Kontrol panelinize tekrar girmeyi denediğinizde, hatayı ekrana basacaktır.

<figure><img src="https://blog.veriloji.com/wp-content/uploads/2020/02/cyberpanel_error-1024x306.png" alt="" height="306" width="1024"><figcaption></figcaption></figure>

Yukarıdaki örnekte, mysql (mariadb) servisi çalışmadığı için hata vermektedir. Mariadb’yi yeniden başlatarak çözüme ulaşabilirsiniz.

```
service mariadb restart
```

<figure><img src="https://blog.veriloji.com/wp-content/uploads/2020/02/cyberpanel_error1.png" alt="" height="309" width="728"><figcaption></figcaption></figure>

Bu örnekte ise, cyberpanel mysql kullanıcısının şifresi hata vermektedir.

Cyberpanel adlı mysql kullanıcısının şifresi aşağıdaki dosyadan öğrenebilirsiniz;

```
nano /etc/cyberpanel/mysqlPassword
```

Burada yer alan şifre ile /usr/local/CyberCP/CyberCP/settings.py dizininde bulunan mysql şifresini karşılaştırın.

<figure><img src="https://blog.veriloji.com/wp-content/uploads/2020/02/cyberpanel_mysql.png" alt="" height="182" width="435"><figcaption></figcaption></figure>

Şifreler uymuyorsa, mysqlPassword dosyasından aldığınız şifreyi buraya yapıştırın ve gunicorn servisini yeniden başlatın;

```
systemctl restart gunicorn.socket
```

Eğer hata almaya devam ediyorsanız, mysql servisinize root olarak bağlanıp “cyberpanel” kullanıcısının şifresini değiştirip, yukarıda belirtilen settings.py dosyasına yapıştırın.

```
mysql --host=127.0.0.1 --port=3307 -u root -p
use mysql;
```

Mysql kullanıcısının şifresini değiştirin;

```
mysql> update user set password=PASSWORD("yenisifre") where User='cyberpanel';
```

Mysql yetkilerini yeniden yükleyin;

```
mysql> flush privileges;
```

Değiştirdiğiniz şifreyi settings.py dosyasına yazıp, dosyayı kaydedin ve gunicorn servisini yeniden başlatın.

```
systemctl restart gunicorn.socket
```

Cyberpanel kontrol paneline <http://IP:8090> şeklinde tekrar girmeyi denediğinizde paneliniz çalışacaktır.

<figure><img src="https://blog.veriloji.com/wp-content/uploads/2020/02/cyberpanel_login.png" alt="" height="457" width="793"><figcaption></figcaption></figure>

<br>

Kaynak : <https://blog.veriloji.com/cyberpanel-server-error-500/>

Bu çözüm bizde işe yaramamıştı, ancak Verilox'un sağladığı bilgi için teşekkür ederiz. Eğer sizde de bu işlem işe yaramadıysa, bir diğer olasılık MariaDB'nin aktif olarak çalışıp çalışmadığıdır.&#x20;

Bunun için 'systemctl status mariadb' komutunu yazmanız gerekmekte. Eğer

```
May 06 00:03:33 hostname.ipadresi /etc/mysql/debian-start[1185]: Upgrading MySQL tables if necessary.
May 06 00:03:33 hostname.ipadresi /etc/mysql/debian-start[1189]: Looking for 'mysql' as: /usr/bin/mysql
May 06 00:03:33 hostname.ipadresi /etc/mysql/debian-start[1189]: Reading datadir from the MariaDB server failed. Got the following erro>
May 06 00:03:33 hostname.ipadresi /etc/mysql/debian-start[1189]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using p>
May 06 00:03:33 hostname.ipadresi /etc/mysql/debian-start[1189]: FATAL ERROR: Upgrade failed
```

Böyle bir sorun yaşıyorsanız, aşağıdaki komutu çalıştırın ve aldığınız hata devam ediyorsa, çözümünü birazdan söyleyeceğim.

```
/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf
```

Bu komutu çalıştırdıktan sonra hala aynı hatayı alıyorsanız, aşağıdaki kodu yazın.

```
nano /etc/mysql/debian.cnf
```

Karşınıza şifre giriş alanı çıkacak; hem 'root' hem de kullanıcı şifreleri boş olabilir. Eğer bizde boştu veya dolu ise, MySQL şifrenizi kontrol edin; eğer eşleşmiyorsa veya boşsa, bu alanı doldurun. Daha sonra sunucuyu yeniden başlatın ve tekrar deneyin.&#x20;

Eğer hala 500 hatası alıyorsanız, son ve etkili çözümümüz olan 'upgrade' işlemi kalıyor demektir.

```
sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)
```

Bu komutu çalıştırdıktan sonra bir süre bekleyin ve sunucunuzun güncelleneceğini göreceksiniz. 500 hatası giderilmiş olmalıdır.&#x20;

Eğer hala aynı hatayı alıyorsanız, artık tek seçeneğiniz sistemi baştan yüklemektir.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.layraweb.com.tr/merhaba/hosting-solution/cyberpanel/500-internal-server-hatasi-cyberpanel.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
